PDA

View Full Version : Grid update failing



arshad3641
23 Feb 2017, 6:24 AM
Hi,

i'm trying to update the grid with different values, when i try updating the bus name column it sucesssfully gets updated , but without touching the bus name.. only I'm updating the time and checkbox og ongoing.. update fails... since it takes the description of the bus as the parameter . and it's allowed only an integer . bus name has id as the valuefield and name as description.. i want to display the description that's why i'm rendering it..
But the problem is when i want just to update the bus timing without touching the Bus name cell it fails.. Please help me


{
text: 'Bus Name',
xtype: 'gridcolumn',
dataIndex: 'bus_name',
flex: 1,
renderer: function(value){
console.log()
if(Ext.isNumber(value)){
var store = this.getEditor().getStore();
return store.findRecord('busid',value).get('busdescp');
}
return value;
},
editor: {
xtype: 'combobox',
allowBlank: true,
displayField: "busid",
valueField: "busdescp",
queryMode: 'local',
mapperId: 'getBusdetails',
lastQuery: '',
editable:true,
//forceSelection: true,
preventMark: true,
readOnly: false,
listeners: {
expand: function () {
var call = this.up('busGrid[itemId=bustimegrid]').getSelectionModel().selection.record.data.networkname.trim();
this.store.clearFilter();
//this.store.filter('call',call);
this.store.filter({
property: 'call',
value: call,
exactMatch: true
})
}
}
}
}55943

Gary Schlosberg
23 Feb 2017, 2:10 PM
Does it fail quietly or is there an error message in console?

arshad3641
23 Feb 2017, 10:23 PM
yes it fails with a error message that .. Cannot bind integer value of that bus name.. that means when i'm just updating the bus timings, and give a update of grid, it takes all the values of that row, and in that bus name column instead of taking the id of the bus it's taking the name and updating the integer only column in the databse, I want the id to be passed to the database when the :girdupdates run..

arshad3641
24 Feb 2017, 4:30 AM
Anyone der.. to provide a solution.