Expandable Text Box

Tami - I think that’s because you are in a new data entry scenario.  Right? In that case the Value is null.  I think you need to check whether Value is present and if not - define the value field with some hard coding,  maybe just a space,  maybe a prepopulated text.

This way the expanding text box can carry a value - regardless of whether or not there is anything in the data. 

Hi Rob,

You are correct. I tried defining the value field with some hard coding but that is where the glitches came in. So if I defined value as a sting or spaces so it is blank, then when I go to enter new data into that field you have to click twice in order to type in the box.

For example I have a list of items I want to paste in the expandable box. I click in the box and click paste. Nothing happens. I have to put my cursor in the box again and paste. Then the data sticks.

I experienced the same issue Nate did with it allowing me to type one character and then the focus of the cursor goes somewhere else on the page. I tried the above code but the text box does not expand. Will the above code work for a text box?

Originally I just used just the skuid portion of the code as an inline snippet. It expanded a text box but the pesky not being able to type thing became an issue:

var $ = skuid.$, field = arguments[0], value = arguments[1];

var model = field.model, row = field.row; var containerDiv = field.element; var fieldText = $('<textarea class="expanding">' + value + '</textarea>'); //Update field value when text is changed $(fieldText).bind('input propertychange', function() { var fieldsToUpdate = {}; fieldsToUpdate[field.id] = $(this).val(); model.updateRow(row, fieldsToUpdate); }); $(containerDiv).append(fieldText);

Our experience with the scenario you describe is as follows. 
1. You have a template with an iFrame somewhere else on your page that is tied to this same model. 
2. When you type a character - the model detects changes, the template says “Ooh - I saw changes and need to let my iFrame know about it” and focus is grabbed by the template. 
3. Having lost focus on your text box, you do somthing like hit the back-space and your browser takes you back a page.   ACK!

So tie the template to another model (even if it sourcing exactly the same data from the same objects)… 

And yes - Text Fields should work with the code above. 

Hi Rob,

I understand what you are saying about what is happening. However, I don’t think I have anything else tied to this model. This model has one field “Invoice Number”. That field is in a field editor (inside a panel set).

I use this field to filter data in another table. The other table is attached to a different model. 

Based on the set up do you see how this could be happening.