1
Help for ParamQuery Pro / Re: DropDown Editor
« on: April 04, 2014, 10:53:17 am »
Hi,
According to your refrence I have implement below code but it is not working.
{title: "VP Assesment", width: 100, dataType: "string", dataIndx: "vp_assessment",
editor: {type: 'select',cls:'prvp', options: ['','YES' ,'NO'],getData: function(ui) {
var val = ui.$cell.find("select").val(),
rowData = ui.rowData;
console.log(rowData);
if( val == 'YES' )
rowData['editable']=true;
else if(val == 'NO')
rowData['editable']=false;
else
rowData['editable']=true;
}
},
filter: {type: 'select',
options: ['','YES' ,'NO'],
condition: 'equal',
listeners: [{change: function(evt, ui) {
filter("vp_assessment", $(this).val());
}
}]
}
},
{title: "Planning Meeting", width: 100, dataType: "string", dataIndx: "planning_meeting",
editor: {
type: dateEditor,
}
var column = $grid.pqGrid('getColumn', { dataIndx: 'planning_meeting'} );
$("#grid_editing").on( "change", ".prvp", function() {
$grid.pqGrid( 'saveEditCell' );
});
$("#grid_editing").pqGrid( {editable:column.editable = function (ui){
return ui.rowData['editable'];
}} );
Please let me know what I am doing wrong.
According to your refrence I have implement below code but it is not working.
{title: "VP Assesment", width: 100, dataType: "string", dataIndx: "vp_assessment",
editor: {type: 'select',cls:'prvp', options: ['','YES' ,'NO'],getData: function(ui) {
var val = ui.$cell.find("select").val(),
rowData = ui.rowData;
console.log(rowData);
if( val == 'YES' )
rowData['editable']=true;
else if(val == 'NO')
rowData['editable']=false;
else
rowData['editable']=true;
}
},
filter: {type: 'select',
options: ['','YES' ,'NO'],
condition: 'equal',
listeners: [{change: function(evt, ui) {
filter("vp_assessment", $(this).val());
}
}]
}
},
{title: "Planning Meeting", width: 100, dataType: "string", dataIndx: "planning_meeting",
editor: {
type: dateEditor,
}
var column = $grid.pqGrid('getColumn', { dataIndx: 'planning_meeting'} );
$("#grid_editing").on( "change", ".prvp", function() {
$grid.pqGrid( 'saveEditCell' );
});
$("#grid_editing").pqGrid( {editable:column.editable = function (ui){
return ui.rowData['editable'];
}} );
Please let me know what I am doing wrong.