EasyUI Forum

General Category => Bug Report => Topic started by: Naresh Mehta on April 22, 2019, 06:33:11 AM



Title: Button in Datagrid fire before select row
Post by: Naresh Mehta on April 22, 2019, 06:33:11 AM
I have used Link Button in the datagrid in particular column, after clicking this button Modal will open with textbox where I can put more line instead writing in datagrid textbox, if user in edit mode the textbox will display store value, but while button click without selecting any row  the row index value is not getting, in this user have to select Row first so index get return according stored data can display in textbox.

Please help, to solve this problem.


Title: Re: Button in Datagrid fire before select row
Post by: jarry on April 22, 2019, 06:20:42 PM
The simple way to get the selected row in the 'onClick' event is to delay a little time to call your code. Please try this code.
Code:
onClick: function(){
setTimeout(function(){
var row = $('#dg').datagrid('getSelected');
},0)
}


Title: Re: Button in Datagrid fire before select row
Post by: Naresh Mehta on April 22, 2019, 09:12:45 PM
Thanks Sir, It is working nicely.