jQWidgets Forums

jQuery UI Widgets Forums Grid getrowid not working after inline editing cell

This topic contains 5 replies, has 4 voices, and was last updated by  admin 8 years, 1 month ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author

  • stlredlink
    Participant

    Hello,

    we have the following issue: We want to retrieve the row id of the selected row. To accomplish that we’re using getselectedrowindex and getrowid. At first glance it seems to work but after editing a cell that uses dropdownlist as columntype 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: 34

    Afterwards edit any cell in the second column (Kl. Nr.) and than click on the button again and you see:
    Row-Index: 2, Row-ID: 2

    Are we able to fix this on our own or is it a bug?

    Best regards


    Hristo
    Participant

    Hello stlredlink,

    Thank you for this feedback.
    We will investigate this case.

    Best Regards,
    Hristo Hristov

    jQWidgets team
    http://www.jqwidgets.com


    stlredlink
    Participant

    Hi Hristo,

    the bug can be reproduced with combobox as columntype too. Seems like there is a bug in jqxgrid.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 pass dataadapter. But it doesn’t contain the original source data like the id settings. Later this source will be used in jqxdata.js in method dataBind 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 given source object.

    Would be nice if that could be fixed…

    Thanks in advance


    Peter Stoev
    Keymaster

    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.


    stlredlink
    Participant

    Hello Peter,

    sorry my fault. ;( I just wanted to help you to find the failure. Can you remove my post than?

    Best regards


    admin
    Keymaster

    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.

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.