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;
}