Mar 17, 2014, 6:08 AM
[CLOSED] How to cancel rowselection in grid panel
I have a gridpanel that bind to a formpanel.
Every time user select other row of gridpanel, I will update the record of the formpanel to the current row of the grid.
I want to add some checking in the "BeforeDeselect" directevent and if the checking not pass, then cancel the deselect event.
Actually, I have tried to do this by listener and do the checking by DirectMethod.
Can give me any suggestion how to do the checking?
Every time user select other row of gridpanel, I will update the record of the formpanel to the current row of the grid.
I want to add some checking in the "BeforeDeselect" directevent and if the checking not pass, then cancel the deselect event.
<DirectEvents>
<BeforeDeselect OnEvent="tblDetail_BeforeDeselect" />
</DirectEvents>
protected void tblDetail_BeforeDeselect(object sender, DirectEventArgs e)
{
//do checking here
}
This problem is DirectEventArgs don't have a parameter cancel. How can I cancel the event in this case?Actually, I have tried to do this by listener and do the checking by DirectMethod.
<BeforeDeselect Handler="
App.direct.chkGridRow();
//chkGridRow will set hidRowChkFlg to 1 if checking not pass
if(#{hidRowChkFlg).getValue() == 1)
return false;
var grid = #{tblDetail}, form = #{pnlDetail};
form.getForm().updateRecord(form.record);
grid.store.sync();
" />
However the value of hidRowChkFlg will not change immediately in client side and just effective after the BeforeDeselect event finished.Can give me any suggestion how to do the checking?
Last edited by Daniil; Mar 21, 2014 at 12:24 PM.
Reason: [CLOSED]