jQuery UI Widgets Forums Grid Access to ComboBox values using Grid event cellendedit?

This topic contains 3 replies, has 2 voices, and was last updated by  alastairwalker 8 years, 3 months ago.

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

  • alastairwalker
    Participant

    I need to access the multiple values in multiselect ComboBox located in a a grid cell once the cell edit has been completed.

    I am trying to access the ComboBox multiple values using the script:

    ‘var items = editor.jqxComboBox(“getSelectedItems”);

    inside the function

    
    { ..., cellendedit: function (row, datafield, columntype, oldvalue, newvalue) 
    {
       'var items = editor.jqxComboBox("getSelectedItems");
    
    }

    but I cannot get the values for items returned. I suspect this happens because the editor has been closed.

    Any ideas on how I can access the ‘items’ when an edit cycle has been completed, will be really valued!

    Alastair


    Peter Stoev
    Keymaster

    Hi alastairwalker,

    You cannot access Grid editors in that event. You can access values in geteditorvalue callback, but if you implement it, you will have to implement what the editor returns, too.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com


    alastairwalker
    Participant

    Ok – I get it!

    Many thanks!

    Alastair


    alastairwalker
    Participant

    By following up your suggestion, I have assembled the following script:

    geteditorvalue: function (row, cellvalue, editor) 
    {
    	var items = editor.jqxComboBox("getSelectedItems");
    	checkedItems = [];
    	jQuery.each(items, function (index)
    	{
    		checkedItems.push(this.label);
    	});
    	var currentValue = checkedItems.join();
    }

    Now what is not clear to me is how to return (i.e. save) the currentValue back into the grid cell.

    I tried ‘return currentValue;’ but this does not yield the correct (or any) result.

    (Also, clicking on a different cell does not seem to close the editor. How does the editor close?)

    Am I missing something here?

    Any guidance on how to save the currentValue in the grid cell will be appreciated!

    Alastair

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

You must be logged in to reply to this topic.