Categories | Question details Back To List | ||
dhtmlxGrid: onRowSelect returns wrong id when enableMultiselect(true) Hi, we testing the dhtmlxGrid component and the problem is : When multiselect is enabled onRowSelect function returns wrong rowId. The test scenario is (tested on "Attaching Event Handlers" (Samples Explorer) with multiselect enabled): 1. CtrlClick at 1st row : returns "Rows with id: 1 was selected by user" 2. CtrlClick at 2nd row :returns "Rows with id: 2 was selected by user" 3. CtrlClick at 4. row :returns "Rows with id: 4 was selected by user" 4. CtrlClick at 2nd row again : returns "Rows with id: 4 was selected by user" is this is a bug, or did we missed something? Thanks in advice, Ayhan Kibar. Answer posted by dhxSupport on May 12, 2009 04:58 Thank you for your note. In the multiselect mode after "onRowSelect" event returns id of the last selected row. After you are clicking on the 2nd row againg 2nd row became unselected. What should "onRowSelect" event handler return in such case? Does it should return id of the 2nd row (which became unselected) or should return nothing? Please tell us what is expected behaviour for you and we will make necessary changes. Answer posted by Ayhan Kibar on May 12, 2009 05:17 Hi, In that case the last clicked rowId should returned. Actually what we need is : mygrid.attachEvent("onRowSelect", doOnRowSelected); // should return last selected rowId mygrid.attachEvent("onRowUnselect", doOnRowUnselected); // should return last unselected rowId
Thanks for advice, Ayhan Kibar. Answer posted by dhxSupport on May 12, 2009 06:51 "onRowSelect" behaviour will be changed in the next version. To get id's of all clicked rows (which was selected or unselected) you can use "onSelectStateChange" which return array of id clicked rows. |