jQWidgets Forums

jQuery UI Widgets Forums Grid Bind Grid after combobox

Tagged: , ,

This topic contains 3 replies, has 2 voices, and was last updated by  ivailo 9 years, 6 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • Bind Grid after combobox #77731

    alorenz
    Participant

    Hey,

    I want to bind a Grid after using a selected index in a combobox. The combobox gets the Data in an JSON Array.
    The selection with the selectedrowindex works fine. But only withe the hole JSON Array, not with the only row.

    $(document).ready(function () {
                    var trackSource ={
                    datatype: "json",
                    datafields: [
                    { name: 'name' },
                    { name: 'id' },
                    { name: 'country' }
                    ],
                    url: 'test_daten.json'
                    };
    
                    var dataAdapter = new $.jqx.dataAdapter(trackSource);
                    $("#vorlagen").jqxComboBox(
                    {
                    source: dataAdapter,
                    theme: 'bootstrap',
                    width: 400,
                    height: 30,
                    selectedIndex: -1,
                    displayMember: 'name',
                    valueMember: 'id',
                    placeHolder: '  suchen' 
                    });
                        
                    $("#vorlagen").jqxComboBox('focus');                
                    $('#vorlagen').on('close',function (event) {
                   
                    var index_2 = $("#vorlagen").jqxComboBox('getSelectedIndex');
                      
                    $("#jqxgrid").jqxGrid({
                    source: trackSource,
                    theme: 'bootstrap',
                    altrows: true,
                    selectedrowindex: index_2,
                    columns: [
    			  { text: 'Kunden Nummer', datafield: 'id', width: 150 },
    			  { text: 'Kunde', datafield: 'name', width: 250 },
    		          { text: 'Ort', datafield: 'country', width: 180 }
    			 ]
                    });
                    
            });
    Bind Grid after combobox #77732

    ivailo
    Participant

    Hi alorenz,

    We tested your code and it works as expected.
    Give more explanation about goal that must be achieved.

    Best Regards,
    Ivailo Ivanov

    jQWidgets Team
    http://www.jqwidgets.com

    Bind Grid after combobox #77734

    alorenz
    Participant

    Hi ivailo,

    I know, the goal is to not to select the row of the Index but only display this row in the grid. Only this one row…

    The json File looks like:

    [
    {"name":"Dressler GmbH","id":"S-500149916","country":"Friedrichshafen"},
    {"name":"Metro Group Asset Management GmbH & Co. KG","id":"G-12444","country":"Saarbr\u00fccken"},
    {"name":"Hackforth Holding GmbH & Co. KG","id":"G-101903","country":"Herne"},
    {"name":"dhmp GmbH & Co. KG","id":"S-500104524","country":"Karlsruhe"},
    {"name":"QSC AG","id":"W-5189382","country":"K\u00f6ln\/M\u00fchlheim"},
    {"name":"Publicis Kommunikationsagentur GmbH","id":"G-13036","country":"Erlangen"}
    ]

    e.g.: {“name”:”Dressler GmbH”,”id”:”S-500149916″,”country”:”Friedrichshafen”}…

    Bind Grid after combobox #77743

    ivailo
    Participant

    Hi alorenz,

    You can filter the results in this case.
    Here is the demo.

    Best Regards,
    Ivailo Ivanov

    jQWidgets Team
    http://www.jqwidgets.com

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

You must be logged in to reply to this topic.