PDA

View Full Version : ExtJs 4.0.7 issue without clicking on CheckboxModel able to open EDIT form



poojagarg89
18 Jan 2012, 10:57 PM
If m selecting grid row and then deselecting it and clicking on EDIT button to open Edit Form its opening and taking the value which I lastSelected in the grid row

In ExtJs 4.0.1 its working fyn but its lib. file giving prob in Google chrome so I changed to 4.0.7 and now new issue cuming up.....

30817





text: 'Edit',
//width:75,
iconCls:'edit',

handler: function(){
temp = "edit";
var sm = Ext.getCmp('grid1').getSelectionModel();

var rec=sm.getLastSelected();
var count=Ext.getCmp('grid1').getSelectionModel().getCount();
// alert("count"+count);
if(count==null){
Ext.MessageBox.alert("<font size=2>Error</font>","Please select user record.");
}else if(count>=2)
{
Ext.MessageBox.alert("Information..","Please select one record.");
}else{
if(sm.getLastSelected()){
user_name = rec.get("user_name");
first_name = rec.get("first_name");
last_name = rec.get("last_name");
address_1 = rec.get("address_1");
address_2 = rec.get("address_2");
city = rec.get("city");
state = rec.get("state");
pin_number = rec.get("pin_number");
email = rec.get("email");
fax = rec.get("fax");
phone_number = rec.get("phone_number");
mobile_number = rec.get("mobile_number");

Ext.Ajax.request({url :'edituserrole.do',
params:{user_name:user_name},
success: function(resp, opt) {
// Ext.Msg.alert('success','Your settings are successfully Updated.');

roleId_store_Edit_grid.load();
}
});

showEditForm_Grid1();
// sm.getLastSelected().removeAll();
}else{
Ext.MessageBox.alert("<font size=2>Error</font>","Please select user record.");
}
}
}


Thanks,
Pooja

mitchellsimoens
19 Jan 2012, 8:46 AM
What's the error? Getting the last selected row?

poojagarg89
19 Jan 2012, 10:58 PM
I resolved the error now its not coming
now all validation messages working fyn :)


Thanks,
Pooja