jQWidgets Forums

jQuery UI Widgets Forums Grid dropdown item select another open dropdown

This topic contains 1 reply, has 2 voices, and was last updated by  Hristo 6 years, 6 months ago.

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

  • Serdar
    Participant

    hello
    when I select an object from the left I want the dropdown on the right to open automatically
    but I’didn’t work..
    I’ve done it before with the “cellbeginedit” but couldn’t remember..

    ("#grid").jqxGrid(
                {
                    width: 300,
                    source: dataAdapter,
                    selectionmode: 'singlecell',
                    editable: true,
                    autoheight: true,
                    columns: [
                        {
                            text: 'Country', datafield: 'Country', width: 150, columntype: 'combobox',
                            cellvaluechanging: function (row, datafield, columntype, oldvalue, newvalue) {
                                if (newvalue != oldvalue) {
                                    $("#grid").jqxGrid('setcellvalue', row, "City", "Select a city...");
                                };
                            }
                        },
                        {
                            text: 'City', datafield: 'City', width: 150, columntype: 'combobox',
    						
    						
    						cellbeginedit: function (row, cellvalue, editor, celltext, cellwidth, cellheight) {
    						editor.jqxComboBox('open');
    						},					
    						
                            initeditor: function (row, cellvalue, editor, celltext, cellwidth, cellheight) {
    						 
                                var country = $('#grid').jqxGrid('getcellvalue', row, "Country");
                                var city = editor.val();
    
                                var cities = new Array();
                                switch (country) {
                                    case "Belgium":
                                        cities = ["Bruges", "Brussels", "Ghent"];
                                        break;
                                    case "France":
                                        cities = ["Bordeaux", "Lille", "Paris"];
                                        break;
                                    case "USA":
                                        cities = ["Los Angeles", "Minneapolis", "Washington"];
                                        break;
                                };
    
                                editor.jqxComboBox({ autoDropDownHeight: true, source: cities });
                                if (city != "Select a city...") {
                                    var index = cities.indexOf(city);
                                    editor.jqxComboBox('selectIndex', index);
    								 
                                }
                            }
                        }
                    ]
                });

    Hristo
    Participant

    Hello Serdar,

    You could try to use cellendedit and after that cellbeginedit method after you set the new value in the “cellvaluechanging” callback.

    Best Regards,
    Hristo Hristov

    jQWidgets team
    http://www.jqwidgets.com

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

You must be logged in to reply to this topic.