jQWidgets Forums
jQuery UI Widgets › Forums › Grid › getrowid not working after inline editing cell
Tagged: #jqwidgets-grid, grid, javascript grid, jquery grid
This topic contains 5 replies, has 4 voices, and was last updated by admin 8 years, 1 month ago.
-
Author
-
Hello,
we have the following issue: We want to retrieve the row id of the selected row. To accomplish that we’re using
getselectedrowindex
andgetrowid
. At first glance it seems to work but after editing a cell that usesdropdownlist
ascolumntype
it doesn’t work anymore.getrowid
returns the row index instead of the row id.see: http://jsfiddle.net/cb943017/1/
To reproduce it:
Select row 3 (Unit-C) and click on the button below the grid and you see:
Row-Index: 2, Row-ID: 34Afterwards edit any cell in the second column (Kl. Nr.) and than click on the button again and you see:
Row-Index: 2, Row-ID: 2Are we able to fix this on our own or is it a bug?
Best regards
Hello stlredlink,
Thank you for this feedback.
We will investigate this case.Best Regards,
Hristo HristovjQWidgets team
http://www.jqwidgets.comHi Hristo,
the bug can be reproduced with
combobox
ascolumntype
too. Seems like there is a bug injqxgrid.edit.js
in method_showcelleditor
:var isdataadapter = this.source._source ? true : false; [...] if (!isdataadapter) { [...] } else { var dataSource = { localdata: this.source.records, datatype: this.source.datatype, async: false } dataadapter = new $.jqx.dataAdapter(dataSource, { autoBind: false, async: false, uniqueDataFields: [displayfield], autoSort: true, autoSortField: displayfield }); } [...] editor.jqxDropDownList({ enableBrowserBoundsDetection: true, keyboardSelection: false, source: dataadapter, rtl: this.rtl, autoDropDownHeight: autoheight, theme: this.theme, width: $element.width() - 2, height: $element.height() - 2, displayMember: displayfield, valueMember: datafield });
As
source
for the row edit widget you passdataadapter
. But it doesn’t contain the original source data like theid
settings. Later thissource
will be used injqxdata.js
in methoddataBind
to recreate `records via:var recordid = me.getid(source.id, record, i); if (typeof (recordid) === "object") { recordid = i; } record.uid = recordid;
But
source.id
is not set in the givensource
object.Would be nice if that could be fixed…
Thanks in advance
stlredlink – please avoid posting our codes as you directly violate the EULA by doing that! If there is an issue, we will resolve it in a future version of the software. For now, we cannot confirm whether we have or do not have. The editor’s data source is not related to other columns data so putting ID there is definitely not necessary or required.
Hello Peter,
sorry my fault. ;( I just wanted to help you to find the failure. Can you remove my post than?
Best regards
Hey stlredlink, no problem. Just keep that in mind for future posts. We added a work item about the reported behavior and will investigate it.
Have a nice and productive day.
-
AuthorPosts
You must be logged in to reply to this topic.