jQuery UI Widgets Forums Lists ListBox Don't show the group

This topic contains 3 replies, has 3 voices, and was last updated by  Dimitar 9 years ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • Don't show the group #70942

    manzam
    Participant

    Hi,
    I’m trying to binding, but I don’t show the groups, Why ?

    My code :

    var source =
    {
    datatype: “json”,
    datafields: [{ name: ‘IdClasificacionDetalle’, type: ‘int’ },
    { name: ‘Nombre’, type: ‘string’ },
    { name: ‘group’, type: ‘string’ }],
    id: ‘IdClasificacionDetalle’,
    url: ‘/Usuario/ListaClasificacionDetalle’
    };
    var dataAdapter = new $.jqx.dataAdapter(source, {
    formatData: function (data) {
    $.extend(data, {
    idEmpresa: _idEmpresa
    });
    return data;
    }
    });
    dataAdapter.dataBind();
    // Create a jqxListBox
    $(“#listboxClasificacionDetalle”).jqxListBox({
    source: dataAdapter, displayMember: “Nombre”, valueMember: “IdClasificacionDetalle”, width: “100%”, height: 250, checkboxes: true
    });
    $(“#listboxClasificacionDetalle”).on(‘checkChange’, function (event) {
    var args = event.args;
    if (args) {
    // index represents the item’s index.
    var index = args.index;
    var item = args.item;
    // get item’s label and value.
    var label = item.label;
    var value = item.value;
    alert(“label: ” + label);
    }
    });

    Don't show the group #70972

    Nadezhda
    Participant

    Hello manzam,

    If you want to show data from ‘group’ datafield you should set ‘displayMember’ or ‘valueMember’ to ‘group’. You can find more information about how to Bind the ListBox to JSON data on Getting Started.

    Best Regards,
    Nadezhda

    jQWidgets team
    http://www.jqwidgets.com/

    Don't show the group #71188

    manzam
    Participant

    Thanks for reply, but I need is show the Group and Name at the same time like de example “Categories”

    as I do?

    Don't show the group #71203

    Dimitar
    Participant

    Hello manzam,

    Setting categories (groups) when loading the listbox from JSON data is not supported. You can, however, try the approach specified in the following post as a workaround: http://www.jqwidgets.com/community/topic/combobox-list-categories/#post-49874.

    Best Regards,
    Dimitar

    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.