Skip to main content

Any one know how to set up value to a dynamic field. I have the function where field name would be sent as parameter and I do need to set value there.

Here is an example
function SetValue(params, Name){
$ = skuid.$;
var fieldName =params.model.getField(Name);
// var Mytext = do my task
if(params.model.getRowById(params.row.Id)[fieldName] !== skuid.$(‘.RichTextField).prop(‘innerHTML’)){            

     params.model.updateRow(params.model.getRowById(params.row.Id),{ fieldName : ‘Mytext’});
            skuid.$(’.RichTextField div.nx-richtext-input’).focus();
        }

}

I don’t think you need to get the reference to the entire field object. You should be able to just use the field name

if(params.rowbName] !== skuid.$(‘.RichTextField).prop(‘innerHTML’)){            

     params.model.updateRow(params.row, Name, ‘Mytext’);
            skuid.$(‘.RichTextField div.nx-richtext-input’).focus();
        }


Thanks Matt,
it works perfect…