|
Title: id of edatagrid in formatter Post by: dnhoang on June 26, 2014, 11:06:34 PM In edatagrid, how to get id of current table in function of formatters such as editrow, deleterow, saverow, cancelrow.
http://www.jeasyui.com/tutorial/datagrid/datagrid12.php (http://www.jeasyui.com/tutorial/datagrid/datagrid12.php) Title: Re: id of edatagrid in formatter Post by: stworthy on June 26, 2014, 11:33:17 PM Once get the row index, you can retrieve the corresponding row data.
Code: var index = ... Title: Re: id of edatagrid in formatter Post by: dnhoang on July 04, 2014, 01:01:32 AM Thanks for your quick reply, stworthy!
But I don't want to to data of row. I want to make action formatter for general use, because I have many edatagrids in tabs, but I only want to have one formatter, if I can get id of current table, I can call functions SAVE, CANCEL, EDIT. For example, I have this formatter: Code: function actionformatter_qc01(value,row,index){and I don't want to call $('#dg01') but for example $(this) or $(table_id), but it does not work. Do you have any suggestion? Title: Re: id of edatagrid in formatter Post by: stworthy on July 04, 2014, 01:51:24 AM Do you wish to get the <table> element bound to datagrid component in the 'save' function? If so, please try the code below:
Code: function saverow(target){Title: Re: id of edatagrid in formatter Post by: dnhoang on July 06, 2014, 08:32:45 PM Thank you stworthy, it works as perfectly as my hope! You are hero ;D!
|