jQWidgets Forums

jQuery UI Widgets Forums Grid Need a little bit of help

Tagged: ,

This topic contains 1 reply, has 2 voices, and was last updated by  Peter Stoev 12 years, 6 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Need a little bit of help #10646

    maasba
    Member

    Getting an error about sorting here.. Not really sure how to fix it. any help you can offer would be appreciated. My service just returns text.

    something that looks like

    dev
    prod
    test
    ua

    etc…..

    $(document).ready(function () {

    $.support.cors = true;
    //url to the service

    var my = {}; //my namespace

    my.EnvObj = function () {
    var self = this;
    self.EnvType = ko.observable();
    }

    my.vm = (function (my) {

    var EnvironmentListing = ko.observableArray([]),
    GetEnvs = function () {
    $.ajax({
    url: “http://172.18.77.135:8095/MainWinServiceOdata.svc/GetMaintEnv”,
    contentType: “application/json”,
    datatype: “json”,
    beforeSend: function (xhr) {
    xhr.setRequestHeader(“Accept”, “application/json;odata=verbose”);
    xhr.setRequestHeader(“MaxDataServiceVersion”, “3.0”);
    },
    success: function (data) {
    $.each(data.d, function (ndex, val) {

    var obj = new my.EnvObj();

    obj.EnvType = val;
    EnvironmentListing.push(obj);
    })

    //// prepare the data
    //var source =
    //{
    // datatype: “json”,
    // datafields: [{ name: ‘EnvType’ }],
    // localdata: EnvironmentListing
    //};
    //var dataAdapter = new $.jqx.dataAdapter(source);

    $(“#jqxgrid”).jqxGrid(
    {
    source: my.vm.EnvironmentListing,
    width: 1024,
    height: 768,
    columns: [{ text: ‘Environment’, datafield: ‘EnvType’ }]
    })

    },
    error: function (xhr, status, error) { alert(“Error:” + error + “, ” + status) }
    });

    }

    return {
    EnvListing: EnvironmentListing,
    GetEnvs: GetEnvs
    };

    })(my);

    my.vm.GetEnvs();

    });

    Need a little bit of help #10651

    Peter Stoev
    Keymaster

    Hi maasba,

    We will not be able to reproduce the issue with the provided code. You wrote that there’s an issue about sorting, but in the provided code, sorting is not enabled because the Grid’s sortable property is not set to true. In addition, the Grid is expected to be bound to jqxDataAdapter instance which is commented in the code. Could you please provide a small sample which we will be able to run locally and which demonstrates the erroneous behavior with the latest version of jQWidgets? If you would like, you can also send the sample to support@jqwidgets.com. We’ll be glad to test and debug it.

    Best Wishes,
    Peter Stoev

    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.