jQuery UI Widgets Forums Grid Combobox in Grid

This topic contains 4 replies, has 2 voices, and was last updated by  Peter Stoev 11 years, 2 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • Combobox in Grid #17820

    Syai
    Participant

    Hi,

    I need help in binding combobox. Here I’ve to get the items to combobox depending on the values selected in another combobox. Suppose I’ve a date column and a combobox column. When I select a date in the row, the data which is related to selected date should be binded to combobox. Can anyone help me how to achieve it?

    Regards,
    Syai

    Combobox in Grid #17859

    Peter Stoev
    Keymaster

    Hi Syai,

    In the “initeditor” callback function of the ComboBox column, you can use the “getrowdata” to get the selected row’s data. That data will contain the data from your Date column, too. Then use can set the “initeditor” to update the source of the ComboBox editor.

    { text: 'Quantity', datafield: 'quantity', width: 200, cellsalign: 'right', columntype: 'combobox',
    initeditor: function (row, cellvalue, editor) {
    editor.ComboBox({ source: newDataAdapter });
    }
    }

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Combobox in Grid #17888

    Syai
    Participant

    Hi Peter,

    Thanks for the reply. Can you please help me regarding how to send the selected row data to server so that I can filter the combobox data with the date while getting from database itself. I’m not much aware of sending the selected row data as parameter to server.

    Regards,
    Syai

    Combobox in Grid #18242

    Syai
    Participant

    Hi,

    Can anyone help me on this. Here I’m trying to pass selected row value to server through source but the value it is passing the value as null. I need to assign the value when the cell value of the row is changed. So I’m calling the dataadapter in initeditor. Below is the piece of code I’ve used in source.

    var moduleSource =        
    {
    datatype: "json",
    datafields: [
    { name: 'Name' },
    { name: 'Id' },
    { name: 'StartDate' },
    { name: 'EndDate' }
    ],
    data: { 'SelectedDate': _selServiceDate },
    id: 'CourseModuleId',
    url: '@Url.Action("GetModulesOnCourseData", "Controller")'
    };
    //INITIALIZE THE DATA ADAPTER FOR THE MODULE SOURCE
    var moduleDataAdapter = new $.jqx.dataAdapter(courseModuleSource, { autoBind: false, async: false});

    Here ” _selServiceDate” is the date I’m getting on selecting the combobox of the row from selected row. This value is not getting sent to the server side.

    Regards,
    Syai

    • This reply was modified 11 years, 2 months ago by  Syai.
    Combobox in Grid #19009

    Peter Stoev
    Keymaster

    Hi,

    I am not sure what moduleAdapter stands for, but if you set the ComboBox’s property to point to that adapter in the “initeditor” callback, the widget will call the dataAdapter’s dataBind method and an Ajax call to the server will be made. Please, note that “initeditor” is called each time a cell editor is opened.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

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

You must be logged in to reply to this topic.