jQuery UI Widgets Forums Grid no data to display

This topic contains 10 replies, has 2 voices, and was last updated by  lorife 9 years, 2 months ago.

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
  • no data to display #72988

    lorife
    Participant

    Hi,
    I’m tring to switch from jqgrid to jqxgrid. I really like what you created!

    Right now the problem is this. I am connecting to DB2 (odbc) and using a query with your grid.
    It works great, but when I add one specific column, the grid just says “no data to display”. I remove that column and it works.
    I thought that some value in the column has some character which “breaks” the grid.

    I am attaching the most important parts:

    1) index.php

    <!DOCTYPE html>
    <html lang="en">
    	<head>
    		<meta charset="utf-8">				
    		<meta http-equiv="Content-Type" content="text/html;" charset="utf-8" />

    2) mycustom.js

     var source = {
        datatype: "json",
        contentType: 'application/json; charset=utf-8',
        datafields: [
          { name: 'Chiave', type: 'string' },    
          { name: 'Rif_Mit', type: 'string' },    
          { name: 'Data_Pren', type: 'string' }
        ],  
        id: 'Chiave',
        url: "gBolleFermeAmag.php"
      };    
      
      var dataAdapter = new $.jqx.dataAdapter(source);
      
      // Creo la griglia
      $("#gMain").jqxGrid({
        width: '100%',
        height: '100%',
        autoheight: false,
        source: dataAdapter,
        filterable: true,
        //showfilterrow: true,
        sortable: true,
        pageable: true,   
        pagesize:20, 
        //columnsresize: true,
        selectionmode: 'singlerow',
        localization: getLocalization('it'),
        columns: [
          { text: 'Chiave', dataField: 'Chiave', width: 200 },    
          { text: 'Rif_Mit', dataField: 'Rif_Mit', width: 100 },    
          { text: 'Data_Pren', dataField: 'Data_Pren', width: 200 }    
        ]
      });  

    3) gBolleFermeAmag.php

     
    header('Content-Type: application/json; charset=utf-8');
    ...
    ...
    ...
    while ($rowarray  = odbc_fetch_array($resultset)) {  
          // Attenzione i campi vanno scritti in maiuscolo
          $responce[] = array(
            'Chiave'        => $rowarray['CHIAVE'],      
            'Rif_Mit'       => $rowarray['BORMI'],
            'Data_Pren'     => $rowarray['BODCV'] 
            );
        };
    	  
    	  echo json_encode($responce);	  

    How can I make it work?
    Thank you!

    no data to display #72994

    ivailo
    Participant

    Hi lorife,

    You have to add that column in your source, grid initialization, odbc query, response etc.

    From your explanation it sounds like a error produced in your php file.
    If there are some error messages in the response, produced from your gBolleFermeAmag.php they make the response different than the expected JSON and the grid do’t accept it like useful data.
    Then you receives that message “no data to display”.

    So check the response in your console when the grid is trying to load data and see what is the problem.

    Best Regards,
    Ivailo Ivanov

    jQWidgets Team
    http://www.jqwidgets.com

    no data to display #72996

    lorife
    Participant

    Hi,

    i did add the column correctly.
    In fact, if (in the sql) i write:

    select 999 as column1 from ….

    i can see 999 in all the rows (correct)

    but if I do:

    select bormi from ….

    i receive “no data to display”

    no data to display #72997

    lorife
    Participant

    I’ve seen that in the resultset there are some “bad” characters.
    Can’t it be that?

    no data to display #73004

    ivailo
    Participant

    Hi lorife,

    The SQL Keywords are case-insensitive ( SELECT , FROM , WHERE , etc), but are often written in all caps. However in some setups table and column names are case-sensitive.

    Send the response in your console when the grid is trying to load data and we will investigate the problem.

    Best Regards,
    Ivailo Ivanov

    jQWidgets Team
    http://www.jqwidgets.com

    no data to display #73009

    lorife
    Participant

    Hi Ivalo.

    I’m aware of that. I’ve written it lowercase just here because it was faster..but as you said it’s case-insensitive.

    Also, as this works:

    SELECT 1 as BORMI

    and this does not:

    SELECT BORMI

    I don’t think it’s a problem with the case.
    also if i write:

    echo $rowarray['BORMI']

    I do receive the values correctly.

    the strange thing is that if i do:

    echo var_dump(json_encode($responce));

    without that field I receive something like:

    string(159366) "[{"Chiave":"15060000002","Data_Bolla":"2015-01-02","Tipo_Porto":"0","Loc_Mit":"MODUGNO
                           ","Pro_Mit":"BA   ","Pro_Des":"NA   ","Colli":"1","Peso":"1.00","Data_Pren":null
    }, ........

    with that field everything changes to:

    bool(false)

    no data to display #73015

    lorife
    Participant

    i don’t know if you need it or not but this is what I get with

    while ($rowarray  = odbc_fetch_array($resultset)) {  
        echo $rowarray['BORMI'] . ';';

    I hope it will help you.

              DOCUMENTI;           C/ASSEGNI;            32928836;                DOCS;                DOCS
    ;        CONTRASSEGNI;           DOCUMENTI;           DOCUMENTI;          BAXTER DOC;           999212275
    ;               00806;              00815A;           DOCUMENTI;          DATALOGGER;               
      DOC;        CONTRASSEGNI;              GADGET;          1461000967;        CONTRASSEGNI;          
      15005610;            15007247;           C/ASSEGNI;            15008290;        CONTRASSEGNI;     
         0000000227;           C/ASSEGNI;           DOCUMENTI;         AGENDE PHSE;                 545;
                     544;                 551;                 552;C266121xxxF150000277;          7559000330
    ;            66588845;            66588853;           DOCUMENTI;           C/ASSEGNI;           STAMPANTE
    ;          DATALOGGER;        CONTRASSEGNI;             9004370;    DOC-119140 CYCLE;            C/ASSGNI
    ;           DOCUMENTI;            66589882;           C/ASSEGNI;           DOCUMENTI;           C/ASSEGNI
    ;          SIM BACKUP;          SIM BACKUP;           C/ASSEGNI;            15021658;            15021659
    ;   66590220/66590219;          0035001856;        CONTRASSEGNI;                   -;           DOCUMENTI
    ;                DOCS;           C/ASSEGNI;        CONTRASSEGNI;           DOCUMENTI;     ANGELO ASCOLESE
    ;C273744xxxF140019011;        CONTRASSEGNI;           TACT 2015;             FATTURE;             FATTURE
    ;           CELLULARE;            15031312;            DEC00445;            DEC00446;            DEC00530
    ;           C/ASSEGNI;        15000458/414;            15000447;          0035003551;           DOCUMENTI
    ;        CONTRASSEGNI;          EGFR 17201;          0000000782;          0000000785;          0000000789
    ;           DOCUMENTI;            66593210;           DOCUMENTI;            ASCOLESE;        803226034690
    ; COMM. DICEMBRE 2014;  COMM.DICEMBRE 2015; COMM. DICEMBRE 2014;  COMM.DICEMBRE 2014;             REICING
    ;             REICING;RAMILI             +;        CONTRASSEGNI;                DOCS;   NAPOLI X MONTREAL
    ;           RICHIESTA;             FATTURE;    DIRITTI DOGANALI;          0035005330;           DOCUMENTI
    ;           C/ASSEGNI;     VACC.DISGUIDATO;       COBNTRASSEGNI;           DEC000714;           C/ASSEGNI
    ;        CONTRASSEGNI;           DOCUMENTI;           STAMPANTE;              SERVER;        CONTRASSEGNI
    ;    DIRITTI DOGANALI;                1670;                1669;                1377;    BOLLE CONSEGNATE
    ;            ZAA0DG45;            ASCOLESE;            ASCOLESE;             FATTURE;               
        .;          STOCCAGGIO;        REPERIBILIT�;             JANUARY;             JANUARY;      JANUARY
     NAPOLI;        JANUARY ROMA;                   .;            ZAA0DLHW;              ARTURO;        
        15059434;    BOLLE CONSEGNATE;               TONER;                DOCS;         2015/045773;   
          2015/045744;           C/ASSEGNI;   INTERVENTO TADDEI;        CALIBRAZIONE;     BOLLE COSEGNATE
    ;             URGENTE;            15063514;            15063339;            15063495;            15063504
    ;            15062514;            15063498;            15063501;            15063503;          8140068359
    ;                DOCS;          1541000035;        CONTRASSEGNI;       ASSICURAZIONI;           DOCUMENTI
    ;         DATA LOGGER;           ESTINTORE;  ECCEDENZA X NAPOLI;          0002000001;               
       60;                  50;          7559001596;           DOCUMENTI;             VIACARD;          
      ASCOLESE;           258613001;         BOLLE CONS.;         BOLLE CONS.;          0000001780; COLLO
     DISGUIDATO BS;           260142001;         BOLLE CONS.;         DATA LOGGER;        CONTRASSEGNI; 
       BOLLE CONSEGNATE;    COLLO DISGUIDATO;           999404357;          0042986378;          0042986605
    ;    COLLO DISGUIDATO;             9004742;                 312;                 315;               
      322;            TELEPASS;         CANCELLERIA;              SO2753;            ZAA0F5SV;          
       VACCINO;          0043000883;          0043000885;          0043003816;          0043004669;   66604043
    /66603776;    BOLLE CONSEGNATE;        125/15338783;   COMM.GENNAIO 2015;          AURICOLARE;   COMM
    .GENNAIO 2015;        GENNAIO 2015;   COMM.GENNAIO 2015;            66604940;    BOLLE CONSEGNATE; DISTRIBUZIONE
     FEBBR;        REPERIBILIT�;          STOCCAGGIO;            FEBRUARY;           WAREHOUSE;         
      WAREHOUSE;           WAREHOUSE;                 UPS;          STOCCAGGIO;        REPERIBILIT�;    
                 POD;            BATTERIA;           DOCUMENTI;         CASSA FRIGO;      STP EX EL218VV
    ;          DATALOGGER;          DOC BAXTER;            ZAA0FPYK;          0043024236;          0043047649
    ;    BOLLE CONSEGNATE;                 DOC;       LAVAPAVIMENTI;            DOC. 251;               
        -;    BOLLE CONSEGNATE;          0035017588;   RESO 1-4056670561;           035018130;          
     271388001;            66607567;    BOLLE CONSEGNATE;          1500013137;         EXTRA CARGE;     
       CONTRASSEGNI;                   -;                   -;             FATTURE;        CALIBRAZIONI;
               DOCUMENTI;          PLAFONIERA;                DOCS;           MATERIALE;          0043110413
    ;          0043110414;           C/ASSEGNI;             DX411ZY;           DOCUMENTI;            ZAA0GPHH
    ;             URGENTE;            ABAGNALE;                CELL;         DATA LOGGER;    COLLO DISGUIDATO
    ;    BOLLE CONSEGNATE;            ALIMENTI;C287119xxxF150004372;           DOCUMENTI;            ASSICUR
    .;               RADIO;              T44277;    BOLLE CONSEGNATE;             ADESIVI;    AWB 160/75375462
    ;            ZAA0HCEF;               TONER;                DOCS;          0043180540;          0043180530
    ;          0043180531;              PEDANE;              RITIRO;C279032xxxF150004638;    BOLLE CONSEGNATE
    ;     AUT. N�15156114;     AUT. N�15156121;     AUT. N�15156140;    AUT. N� 15156923;     AUT. N�15156924
    ;          DATALOGGER;             URGENTE;          0043200408;          0043200417;          0043205259
    ;      AUT.N'15156111;              PEDANE;             FRAGILE;           DOCUMENTI;    COLLO DISGUIDATO
    ; DISTRIBUZIONE MARZO;                FUEL;          FUEL MARCH;  AVAILABILITY MARCH;    MONTLY RENTAL
     CT;MONTLY RENTAL NAPOLI;  MONTLY RENTAL ROMA;               MARZO;               VARIA;            66614908
    ;    BOLLE CONSEGNATE;    BOLLE CONSEGNATE;             S209182;            66615053;               
     DOCS;       DOC-ORIGINALI;           RIT. 1 HC;          DATALOGGER;          0043230651;          
     DOCUMENTI;                   -;                DOCS;          K515009784;                   -;     
        N.ORD. 3542;          CONSEGNATE;          0043242744;               EXTRA;               20KIT;
               PERSONALE;               BUSTA;             DRY ICE;15193791  1306690062;          0043259853
    ;         TELECOMANDI;                 POD;          ORDER 3647;            DEC02871;            DEC03165
    ;            DEC03245;          FUEL APRIL;             VACCINO;             VACCINO;             VACCINO
    ;                DOCS; DOCUMENTI ORIGINALI;          0043278975;          0043278977;15207246  1306708789
    ;                DOCS;                 DOC;                 DOC;                 DOC;               TENDA
    ;             DRY ICE;                DOCS;         RESO PEDANE;           BOX VUOTI;             1031400
    ;          0043301760;          0043302489;15223031  1306729096;15223032  1306729098;          0043306014
    ;           273068001;        FOTO TESSERE;             1031401;             IMBALLI;           DOCUMENTI
    ;            ZAA0UK51;          0043318601;          0043320278;          0043318584;15233060  1306747641
    ;            66623776;C287961xxxF150005854;          DATALOGGER;          DOC BAXTER;DISTRIBUZIONE APRILE
    ;              RAMILI;TOPI PADOVA-POZZILLI;          MI/166/MIP;              APRILE;         ADDEB.EXTRA
    ;        AVAILABILITY; MONTHLY RENTAL ROMA;MONTLY RENTAL NAPOLI;MONTLY RENTAL CATANI;          STOCCAGGIO
    ;        REPERIBILIT�;          0043347268;                4418;                4453;           2015
    /1467;           2015/1539;               BOLLE;             GALARDI;          0043357668;          0043357665
    ;          0043357666;          0043357648;          0043357649;                4618;C263730xxxF150006044
    ;               BOLLE;                DOCS;                 POD;                 POD;               
      DDT;        CONTRASSEGNI;              RAMILI;C288064xxxF150006133;             1053437;          
       1053428;             1001073;              DRYICE;        CONTRASSEGNI;          EGFR 18313;     
              CANC.;                CANC;      ORD.MI/186/MIP;             FATTURE;           C/ASSEGNI;
                OLIO ELF;        CONTRASSEGNI;               BOLLE;           DOCUMENTI;               BOLLE
    ;           C/ASSEGNI;               CARTA;            ASCOLESE;           C/ASSEGNI;         BORSE TERM
    .;          0043391554;          0043394038;          0043394039;15266886  1306814445;        CONTRASSEGNI
    ;            66627853;            PAMPLONA;         CARTAXBOLLE;          0043399591;15269640  1306824123
    ;        CONTRASSEGNI;               BOLLE;            ZAA0M19Y;            ZAA0M1AN;    DIRITTI DOGANALI
    ;C288177xxxF150006352;    FUEL TO 15.05.15;    COMM.APRILE 2015;           C/ASSEGNI;          0043408458
    ;15274179  1306836357;          0000005619;          7559005804;          7559005806;            11000281
    ;            66629339;            66629153;          0035040836;  VACCINO DISGUIDATO;               BOLLE
    ;   DOC BAXTER+LOGGER;                DOCS;            Q80KTEST;             DRY ICE;          0043418356
    ;          0043418357;          0043418358;               BOLLE;                 POD;            DEC03888
    ;            DEC03889;            DEC03890;   NERVIANO X TRENTO;        DOC INNOPLUS;DRY SHIPPERX CASERTA
    ;               BOLLE;        DOCS URGENTI;            REITHERA;C288338xxxF150006630;C288335xxxF150006632
    ;     AWB 17293465724;            66631667;   66631834/66631835;               130/M;               BOLLE
    ;             1047954;            ZAA0MNLZ;          N.ORD 3861;          0043444240;          0043444242
    ;          0043444243;          0043444246;          0043444247;          0043444248;               BOLLE
    ;          BRTE 00076;                CAVI;            DEC04106;           DOCUMENTI;C276345xxxF150006737
    ;C288396xxxF150006739;C288397xxxF150006743;              955036;              955000;        RITIRO BUSTA
    ;C244992xxxF150006827;          STOCCAGGIO;        REPERIBILIT�;            ZAA0MX1T;             1053620
    ;          0043455163;C272218xxxF150006914;                FUEL;              MAGGIO;DISTRIBUZIONE MAGGIO
    ;    AVAILABILITY MAY;  MONTHLY RENTAL NAP;  MONTHLY RENTAL CTA; MONTHLY RENTAL ROMA;          0043458391
    ;          0043464135;                 POD;       ASSICURAZIONE;          1511003028;               
      POD;          0043473748;          0043474310;                 POD;            TELEPASS;          
          1101;                1102;         RESO PEDANE;           DETERSIVO;           DOCUMENTI;     
       CONTRASSEGNI;15323331  1306957890;15323319  1306957836;C277574xxxF150007044;          0043503087;C286576xxxF150007212
    ;               BOLLE;TRASF. GHIACCIO SECC;15333854  1306980102;          0000006690;            66637800
    ;               BOLLE;C288622xxxF150007250;               BOLLE; CILIEGE THERMOFRIGO;               
      POD;               50KIT;           C/ASSEGNI;        CONTRASSEGNI;15338805  1306990388;          0043540934
    ;          1511003260;       PRESA 1 FRIGO;               BOLLE;             1001189;               
      POD;            15003326;15343964  1307002173;                5836;                5835;          
          5834;                5832;                5829;                5815;                5825;     
               5818;          1461001141;C267103xxxF150007313;C288639xxxF150007326;C284003xxxF150007353;
                CILIEGIE;           SO9005780;                6217;                6221;                6276
    ;                6275;                6274;                6273;                6272;               
     6238;                6237;                6236;                6235;                6234;          
          6233;                6232;                6231;                6230;                6229;     
               6228;                6227;                6226;                6225;                6224;
                    6223;                6258;                6260;                6255;                6265
    ;                6264;                6263;                6262;                6261;               
     6259;                6257;                6256;          0000006988;C262511xxxF150007368;C268403xxxF150007386
    ;   5KITS ASTRAZENECA;            ZAA0PN35;                6095;                6094;               
     6085;                6084;                6083;                6086;                6090;          
          6091;                5950;                5958;                5959;                5960;     
               5961;                5962;                5963;                5964;                5965;
                    5966;                5967;                5968;                5969;                6003
    ;                6004;                6005;                6006;                6007;               
     5990;                5992;                5993;                5994;                5995;          
          5996;                5987;                5988;                5989;                5954;     
               5955;                5956;                5957;C281630xxxF150007434;          8150047870;
                   BOLLE;           BRTE00121;        POD MANCANTI;               BOLLE;       NUM. ORD 3945
    ;            ZAA0PWG0;              DOMIC.;              DOMIC.;           DOCUMENTI;          0043583439
    ;                 237;C282909xxxF150007494;C284272xxxF150007495;C281440xxxF150007501;C288680xxxF150007503
    ;C281724xxxF150007506;C207485xxxF150007507;C279005xxxF150007510;C258395xxxF150007511;C284366xxxF150007512
    ;C286047xxxF150007517;           005100691;           005100674;           275142001;          1511003358
    ;          8150048795;           BORSA N�3;                8303;                DOCS;               
      POD;          1511002892;       LETTERA N�127;                 POD;                 POD;          
         N'729;           005106835;           005107499;           005105772;          0043585502;     
         0043584316;          0043585622;          0043585623;          0043585167;          0043584029;
              0043584034;          0043584864;          0043585170;          0043585164;          0043585165
    ;          0043585169;          0043585163;          0043584849;          0043585612;          0043585613
    ;          0043585614;          0043584853;          0043584750;          0043585609;15360842  1307037810
    ;          0043585473;15360840  1307037806;          0043607255;          0043585296;15360831  1307037788
    ;15360838  1307037803;15360849  1307037867;15360839  1307037804;15360871  1307037909;15360870  1307037907
    ;15360559  1307037471;15360843  1307037812;15361302  1307038765;15360923  1307038221;15361287  1307038514
    ;          0043607542;          0043607534;          0043607535;          0043607538;          0043607530
    ;          0043607531;          0043607529;          0043607533;          0043607242;          0043607102
    ;          0043607103;          0043607528;          0043585500;15360546  1307037410;          0043606976
    ;          0043606825;          0043606826;          0002038162;          0002038163;          0002038164
    ;          0002038165;          0002038166;          0002038167;          0002038168;          0002038169
    ;            66639694;            66641232;          0000007212;          0000007213;          0000007215
    ;          0000007219;            11001352;            66641550;      55007264/51367;            11001360
    ;            11001359;            66641439;          7559007623;          7559007661;          7559007648
    ;          7559007682;           005105069;           005107167;           005107256;           005107326
    ;           005109195;          7559007683;C268295xxxF150007522;C288691xxxF150007524;C288702xxxF150007528
    ;C282761xxxF150007531;C245576xxxF150007532;C276895xxxF150007533;C269235xxxF150007535;C283457xxxF150007541
    ;C264658xxxF150007543;C279730xxxF150007545;           005107306;           005109210;           005109211
    ;            53002193;            53002187;            53002171;            53002170;       51004156
    /0269;           005107159;           005107160;                1308;          0035052323;          0035052334
    ;          0035052354;          8150049074;          8150049031;          8150049178;          8150049147
    ;          8150049087;          8150049150;          8150049302;          8150049030;          8150049186
    ;          8150049102;          8150049389;          8150049117;          8150049132;          8150049054
    ;          8150049027;          8150049123;          8150049079;          8150049385;          8150049118
    ;          8150048958;          8150048956;          8150049180;          8150049191;          8150049075
    ;               BOLLE;           C/ASSEGNI;         DATA LOGGER;         CONTENITORI;          DATALOGGER
    ;        CONTRASSEGNI;         CONTENITORE;    EGFR 20419-20420;        NUM ORD 3955;  RESO 1-13960392774
    ;               BOLLE;          K515018191;              976726;           EASYSPRAY;          4500100794
    ;
    no data to display #73048

    ivailo
    Participant

    Hi lorife,

    We do not think this issue is related to our widgets and cannot provide you with any more help. You would have to solve it yourself.

    Best Regards,
    Ivailo Ivanov

    jQWidgets Team
    http://www.jqwidgets.com

    no data to display #73063

    lorife
    Participant

    I’m sorry but I don’t understand your answer…you just don’t tell me anything else?
    Ok you don’t think it’s your widget..but why? any help on solving the problem?
    I just followed your guide..

    no data to display #73078

    ivailo
    Participant

    Hi lorife,

    Our responsibility is to support the clients how to integrate jqWidgets. The widget can be integrated well, but if you give wrong/not correct/incomplete/etc unexpected data that will produce malfunction of the widget. You only have to provide correct data. The technology used like backend may differ a lot. You are prefered to work with DB2 and is expected to know how to generate correct data and to provide it to the widget.

    From the conversation until now is visible that when you try to select not existing column from your database table, that gives you an error message, respectively false. This is the reason why you receives false instead correct JSON. We don’t have complete information about your database, backend php etc. so this is the most that we can help you.

    Best Regards,
    Ivailo Ivanov

    jQWidgets Team
    http://www.jqwidgets.com

    no data to display #73087

    lorife
    Participant

    I can assure you that the column exists, otherwise the “echo” would not work and I wouldn’t have been able to paste you the text.

    To prove that, I tried the same “while” with jqgrid and it works.

    but ok, if you don’t want to investigate..fine.

    have a good day.

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

You must be logged in to reply to this topic.