ParamQuery grid support forum
General Category => Help for ParamQuery Pro => Topic started by: EPM Solutions on September 20, 2017, 11:37:51 am
-
Hi team,
I want to trigger a function onchange dropdown list. I am using below code from the paramquery site which is not working for us. I want to call function1 on selecting Action1 option and function2 on selecting Action2 from the below code. How to achieve this.? Please response asap.
{ title: "Action", width: 150, dataType: "string",
editor: {
type: 'select',
options: ['--None--', 'Action1', 'Action2'],
getData:function(ui){
ui.$cell.find("select").val();
console.log(ui.$cell.find("select").val())
}
}
},
---------------------
I have used listeners also as below, but not working.
function action_handler() {
alert('Success');
}
{ title: "Action", width: 150, dataType: "string",
editor: {
type: 'select',
options: ['--None--', 'Action1', 'Action2'],
listeners: ['change', action_handler]
}
},
-
Any event to editor can be bind in editor.init callback.
init: function(ui){
ui.$editor.on('change', function(){
alert($(this).val());
});
},
-
Thanks team,
this is working as expected. How can I change the colModel title based on condition from below code?
obj.colModel = [{ title: "Status", width: 150, dataType: "string", dataIndx: "Status"},
{ title: "Action", width: 150, dataType: "string",
editor: {
type: 'select',
options: ['--None--', 'In', 'Out'],
init: function(ui){
ui.$editor.on('change', function(){
if ($(this).val() == "In") {
// I want to set Status as active for this particular row;
} else if($(this).val() == "Out") {
// I want to set Status as Inactive for this particular row;
}
});
}
}
]
-
Have you tried updateRow method to update the values in the same row?
-
I have got it solved using getRowData method as below,
var column = $( ".selector" ).pqGrid("getRowData", {rowIndx: rowIndx} );
column.Status = "Active";
$( ".selector" ).pqGrid("refresh");
Thanks