Skip to main content

we have a java script in field on a table. In this Field we are displaying different fields based on some pick list values.Before It was working fine .


when ever we tried to edit the this field its becoming readonly after editing it which was not happening before. Please find the code below :


var $ = skuid.$, model = arguments[0].model,

row = arguments[0].row ,

element = arguments[0].element;

var valueType = model.getFieldValue( row , ‘Data_Type__c’ );


function renderField( fieldName,defaultValue ){

var field = new skuid.ui.Field( row, model, null, { fieldId: fieldName, register: true } ),

value = model.getFieldValue( row , fieldName ) ||defaultValue;

console.log( field, value );

if(field && field.metadata && field.metadata.displaytype ){
//skuid.ui.fieldRenderers
console.log( fieldName + ’ rendered!', field.element );

skuid.ui.fieldRenderersdfield.metadata.displaytype].edit( field, value );

}

return field.element;

}


switch ( valueType ){

case ‘Extended Amount’:

element.append(

//$(‘’).text(’ Qty: '),


        renderField( 'Quantity__c' ,''),
// $('<span>').text(' Unit: '),

renderField( 'Unit__c','' ),
// $('<span>').text(' Rate: '),

renderField( 'Rate__c','' ),
// $('<span>').text(' Total: '),

renderField( 'Total__c' ,'') );
break;

}

As added clarification, we’ve attempted to configure a custom field renderer that renders a certain in table row based on the value of another field. For some reason, when a value is keyed into the rendered field, about 2 seconds after the last keystroke, the field becomes read-only (i.e. non-editable; italicized in yellow)–see screenshot. How can we modify the code to prevent this from happening?


Soundar - Please file a ticket with Skuid support as well. This issue is putting the release schedule at risk. Thanks!


We’ll get back to you guys this morning on this.  I don’t think further escalation is necessary. 


A few questions: 

1. What version of Skuid are you running?
2. Do you have any other components tied to this model and fields?  (We’ve especially found this to be a problem when you have a template component with an iFrame tied to the same model where you are doing data entry.  In this case the iFrame rerenders on any data change - which resets that field…
3. It doesn’t look like the full code is copied above.  There is only one case in your switch statement. 
4. What is the default mode of the table? Is it read only by default? 


Would you mind giving us login rights to your org so we can take a look at what is going on?   Here is how: 

1. Use this tutorial to give us login rights: http://help.skuidify.com/m/getting-started/l/182412-getting-help-how-to-grant-skuid-login-rights-to-your-org

2. Then send an email to support@skuidify.com  with the following information: 

- Your org Id 

- The name of the page where the problem is happening 

- The steps required to reproduce the problem.  

We’ll see what’s going on...

Yes we can do that.thanks


Changing this line in your snippet…

var field = new skuid.ui.Field( row, model, null, { fieldId: fieldName, register: true } ),

to…

var field = new skuid.ui.Field( row, model, null, { fieldId: fieldName, register: true, mode: ‘edit’ } ),

should fix your issue.


Thanks. it resolved the issue.


Reply