jQWidgets Forums

jQuery UI Widgets Forums Grid Grid cell drop down edit

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

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
  • Grid cell drop down edit #31940

    dev_pepper
    Participant

    Hi,

    Here is my grid cell drop down edit code..

    For ajax call

          var url = "itemStocks/get_all_item_stocks_for_select";
    var dropDownListSource =
    { type : "GET",
    datatype: "json",
    datafields: [
    { name: 'itemId' },
    { name: 'itemName' }
    ],
    id: 'itemId',
    url: url
    };
    var dropdownListAdapter = new $.jqx.dataAdapter(dropDownListSource, { autoBind: true, async: false });

    For cell edit

    { text: 'Item Nmae',columntype: 'dropdownlist', datafield: 'itemName', width: 130, minwidth: 130,sortable:false, 
    createeditor: function (row, cellvalue, editor, cellText, width, height) {
    editor.jqxDropDownList({
    source: dropdownListAdapter, displayMember: 'itemName', valueMember: 'itemId', width: width, height: height, theme: theme,
    selectionRenderer: function () {
    return "Please Choose:";
    }
    });
    },

    },

    I have set valueMember propery.But it only returns displayMember not id.

    How can i return id for edited element .

    Thanks

    Grid cell drop down edit #31945

    Peter Stoev
    Keymaster

    Hi dev_pepper,

    Please, see this sample: http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/gridkeyvaluescolumnwitharray.htm?arctic. It shows how to implement DropDownList Editor with Key/Value fields.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Grid cell drop down edit #31990

    dev_pepper
    Participant

    Is it not possible with json?.my grid is constructing from json.

    Thanks

    Grid cell drop down edit #31994

    Peter Stoev
    Keymaster

    Hi dev_pepper,

    It is possible with any of the supported data sources – xml, json, jsonp, csv, tsv, array.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Grid cell drop down edit #31998

    dev_pepper
    Participant

    I have tried with json.check my first discussion.have i done anythig worg.My problem it does not return value member parameter.
    can you please help me to do it with json instead of array?

    Grid cell drop down edit #32004

    Peter Stoev
    Keymaster

    Hi dev_pepper,

    The Data Source Type is not important. I saw your code and as I see missing parts in it I suggested you to look the sample. Please, take a look at the sample in details if you would like to learn how to initialize jqxDropDownList editor from custom data source.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Grid cell drop down edit #32010

    dev_pepper
    Participant

    Now I got id from my drop down key value pair set.but it has a problem.After i perform a cell edit,the cell vaue becomes id(like 1,2..) insted of item name (item1,item2..)

    { text: 'Item Name',columntype: 'template', datafield: 'itemName', width: 130, minwidth: 130,sortable:false,
    createeditor: function (row, cellvalue, editor, cellText, width, height) {
    // construct the editor.
    editor.jqxDropDownList({
    source: getEditorDataAdapter(itemName), displayMember: 'name', valueMember: 'id', width: width, height: height, theme: theme,
    });
    }
    },

    Can you help me to fix this?
    Thanks.

    Grid cell drop down edit #32017

    Peter Stoev
    Keymaster

    Hi dev_pepper,

    Unfortunately, I think that you still have not looked at the suggested sample. The column’s initialization in the provided code is missing the “displayfield” member as demonstrated in the sample.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Grid cell drop down edit #32021

    dev_pepper
    Participant

    Hi Peter Stoev.

    I added “displayfield” as my item name and “datafield” as my itemId but no use..iam trying with json..can you please give me an example with json?.

    Thank you..

    Grid cell drop down edit #32041

    dev_pepper
    Participant

    Great Thanks..It works for me..you people have done really great..

    Thanks.

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

You must be logged in to reply to this topic.