jQWidgets Forums

jQuery UI Widgets Forums Grid How to Make a Dropdownlist Visible on Grid Load

Tagged: 

This topic contains 1 reply, has 2 voices, and was last updated by  Mariya 10 years, 1 month ago.

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

  • simpzoid
    Participant

    Hi,

    Sorry if I missed this in the docs but when I load a grid with a dropdownlist in one column the drop down list is not displayed until the cell is clicked. How do you make the default behavior show the dropdownlist when the grid is loaded?

    Here is some demo code:

    <script type=”text/javascript”>

    $(document).ready(function () {

    var data =
    [
    {CompanyName : ‘big co’, ContactName : ‘big boss’ },
    {CompanyName : ‘little co’, ContactName : ‘little boss’ }
    ];

    var dd_data =
    [
    {id : ‘1’, name : ‘Lavazza’ },
    {id : ‘2’, name : ‘Nescafe’ }
    ];

    var source =
    {
    localdata: data,
    datatype: “array”
    };

    var dataAdapter = new $.jqx.dataAdapter(source, {
    loadComplete: function (data) { },
    loadError: function (xhr, status, error) { }
    });

    $(“#jqxgrid”).jqxGrid(
    {
    source: dataAdapter,
    editable: true,
    columns: [
    { text: ‘Company Name’, datafield: ‘CompanyName’, width: 100 },
    { text: ‘Contact Name’, datafield: ‘ContactName’, width: 100 },
    { text: ‘Coffee’, width: 100, columntype: “dropdownlist”, initeditor: function (row, cellvalue, editor, celltext, cellwidth, cellheight)
    {
    editor.jqxDropDownList({ source: dd_data, displayMember: ‘name’, valueMember: ‘id’, selectedIndex: 0 });
    }
    }
    ]
    });

    });
    </script>

    <body class=’default’>

    <div id=’jqxgrid’>
    </div>
    <div style=”font-size: 12px; font-family: Verdana;” id=”selectionlog”>
    </div>

    </body>

    Any help would be gratefully received.

    Regards,
    Scott


    Mariya
    Participant

    Hi simpzoid,
    Unfortunately it is not possible for the jqxDropDownList to be opened on jqxGrid’s loading. You can open the jqxDropDownList by mouseover event on the cell by using the ‘autoOpen’ property.

    Best Wishes,
    Mariya

    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.