Forum Replies Created

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts

  • gudboisgn
    Participant

    Hello Stanislav,

    I tried to refresh grid after updating DataAdapter, like this shown below but column header get rendered but none of the localdata are being rendered.
    i have tried.

        this.dynamicSource.localdata = data['students'];
        this.dynamicAdapter = new jqx.dataAdapter(this.dynamicSource,{
          autoBind: true,
        });
        
        this.examSubjectGrid.refresh();

    I have also, tried:

    this.examSubjectGrid.refreshData();
    this.examSubjectGrid.render();
    in reply to: formatString in jqxDateTimeInput formatString in jqxDateTimeInput #98818

    gudboisgn
    Participant

    Hello Stanislav,
    Is it Bug within jqxDateTime widget (jqwidget library).


    gudboisgn
    Participant

    hi, Ivo Zhulev

    How to set the source again with the new data, as data comes from api url defined in source.url;
    I could not get you,


    gudboisgn
    Participant

    Thank You! Ivo Zhulev

    How can we refresh/reload combobox data.


    gudboisgn
    Participant

    Hello Hristo,
    Thank You For your quick response& help.


    gudboisgn
    Participant

    Hello Hristo,
    Thank you for help, and how can we format the data before rendering the data in grid.
    example my server side api returns:

    {
     data{
       items:[
         {name:'a', code:'546',...},
         {name:'b', code:'738',...},
         {name:'c', code:'893',...},
       ],
       per_page:20,
       to:20,
       total:1500,
       page:1
     },
     message: 'Data Reterieved'
    }

    data fields for the table column are within items of json.
    i have set my root: 'data>items' , but it wont work.

    And setting source.totalrecords gives following error :
    Cannot read property ‘totalrecords’ of undefined

    Here is my complete Code:

     this.source =
          {
              datatype: "json",
            //   localData: {},
              datafields: [
                    { name: "id",  type: "string" },
                    { name: "code", type: "string" },
                    { name: "name", type: "int" },
                ],
              id: "id",
              root: "data>items",
              pagesize: 20,
              url: myUrl,
          }
        
          this.dataAdapter = new jqx.dataAdapter(this.source,{
            formatData: function(data) {
              data["page"] = data["pagenum"];
              data["limit"] = data["pagesize"];
              return data;
            },
            downloadComplete: function(data, status, xhr) {
                if (!this.source.totalrecords) {
                    this.source.totalrecords = data.data.total; 
                }
            }
          });
    
          this.columns =
          [
              { text: "Id", datafield: "id", width: 50 },
              { text: "Code", datafield: "code", width: 120 },
              { text: "Name", datafield: "name", width: 120 }
          ];

    gudboisgn
    Participant

    Hello Hristo,
    Thank you for help, and how can we format the data before rendering the data in grid.
    example my server side api returns:

    {
     data{
       items:[
         {name:'a', code:'546',...},
         {name:'b', code:'738',...},
         {name:'c', code:'893',...},
       ],
       per_page:20,
       to:20,
       total:1500,
       page:1
     },
     message: 'Data Reterieved'
    }

    data fields for the table column are within items of json.
    i have set my root: 'data>items' , but it wont work.

    And setting source.totalRecords gives following error :
    Cannot read property 'totalRecords' of undefined

    Here is my complete Code:

     this.source =
          {
              datatype: "json",
            //   localData: {},
              datafields: [
                    { name: "id",  type: "string" },
                    { name: "code", type: "string" },
                    { name: "name", type: "int" },
                ],
              id: "id",
              root: "data>items",
              pagesize: 20,
              url: myUrl,
          }
        
          this.dataAdapter = new jqx.dataAdapter(this.source,{
            formatData: function(data) {
              data["page"] = data["pagenum"];
              data["limit"] = data["pagesize"];
              return data;
            },
            downloadComplete: function(data, status, xhr) {
                if (!this.source.totalRecords) {
                    this.source.totalRecords = data.data.total; 
                }
            }
          });
    
          this.columns =
          [
              { text: "Id", datafield: "id", width: 50 },
              { text: "Code", datafield: "code", width: 120 },
              { text: "Name", datafield: "name", width: 120 }
          ];
Viewing 7 posts - 1 through 7 (of 7 total)