1. #1
    Ext User
    Join Date
    Jul 2007
    Posts
    4
    Vote Rating
    0
    Bor is on a distinguished road

      0  

    Default What's wrong with my grid+php+mysql

    What's wrong with my grid+php+mysql


    I can see the Grid but no the information JSON inside.
    Somebody can help me.

    ###############################################
    --------------------------
    .JS FILE
    ---------------------------
    var myGrid = function() {
    return {
    init: function() {
    //we enable the QuickTips for the later Pagebar
    Ext.QuickTips.init();
    // create the Data Store
    var ds = new Ext.data.Store({
    proxy: new Ext.data.HttpProxy({url: 'tutorial1.php'}),
    reader: new Ext.data.JsonReader({
    root: 'results',
    totalProperty: 'total',
    id: 'id'
    },
    [
    {name: 'id', mapping: 'id', type: 'int'},
    {name: 'nombre', mapping: 'nombre', type: 'string'},
    {name: 'apellido', mapping: 'apellido', type: 'string'},
    {name: '2apellido', mapping: 'apellidos', type: 'string'}
    ]),
    // turn on remote sorting
    remoteSort: true
    });
    //we set the deafault sort to the id ascending
    ds.setDefaultSort('id', 'ASC');

    // now we create the Grid Columns
    var cm = new Ext.grid.ColumnModel([
    {header: "ID", dataIndex: 'id', width: 70, sortable: true, align: 'right'},
    {header: "Nombre", dataIndex: 'nombre', width: 100, sortable: true},
    {header: "1er Apellido", dataIndex: 'apellido', width: 200, sortable: true},
    {header: "2

  2. #2
    Ext JS Premium Member cdomigan's Avatar
    Join Date
    Mar 2007
    Posts
    148
    Vote Rating
    1
    cdomigan is on a distinguished road

      0  

    Default


    Are you using Firebug? If so, is your server returning the expected JSON response?

  3. #3
    Ext User
    Join Date
    Jul 2007
    Posts
    4
    Vote Rating
    0
    Bor is on a distinguished road

      0  

    Default JSON result from php file

    JSON result from php file


    No I'm begginer and I not using Firedebug.
    THX

    Here's the Result from the PHP file.

    ({"total":19,"results":[{"id":"1","nombre":"JUAN","apellido":"MANZANARES","apellidos":"GONZALEZ"},{"id":"2","nombre":"DANIEL","apellido":"REYES","apellidos":"ELDBLOM"},{"id":"3","nombre":"MIGUEL","apellido":"PEREZ","apellidos":"PEREZ"},{"id":"4","nombre":"JACINTO","apellido":"PAREJA","apellidos":"ZAYAS"},{"id":"5","nombre":"PEDRO","apellido":"PACO","apellidos":"PACO"},{"id":"6","nombre":"PEDRO","apellido":"PACO","apellidos":"PACO"},{"id":"7","nombre":"ROBIN","apellido":"REYES","apellidos":"ELBLUM"},{"id":"8","nombre":"MARIA","apellido":"PEREZ","apellidos":"GARCIA"},{"id":"9","nombre":"JOSE ANTONIO","apellido":"GONZALEZ","apellidos":"LOPEZ"},{"id":"10","nombre":"ALMUDENA","apellido":"SANCHO","apellidos":"MARTINEZ"},{"id":"11","nombre":"LUTI","apellido":"YAGUE","apellidos":"KAKI"},{"id":"12","nombre":"XXXXXXXX","apellido":"XXXXXXXXXX","apellidos":"XXXXXXXXXX"},{"id":"13","nombre":"","apellido":"GIL","apellidos":"CALDER"},{"id":"14","nombre":"BORJA","apellido":"MAZO","apellidos":"ESTEBANEZ"},{"id":"15","nombre":"FRANCISCO","apellido":"AGUILAR","apellidos":"GAMARRO"},{"id":"16","nombre":"CARLOS","apellido":"MERINO","apellidos":"DE LA GUARDIA"},{"id":"17","nombre":"FRANCISCO","apellido":"MORENO ","apellidos":"GOMEZ"},{"id":"18","nombre":"AUGUSTO","apellido":"AVILA","apellidos":"MARTIN"},{"id":"19","nombre":"M","apellido":"CAMPOS","apellidos":"MARTIN"}]})

  4. #4
    Ext User
    Join Date
    Jul 2007
    Posts
    29
    Vote Rating
    0
    bd318 is on a distinguished road

      0  

    Default


    In the last row of your php file, there is a space in the variable name:
    echo '({"total":'.$count.',"results":'.json_encode($myF riends).'})';

  5. #5
    Ext User
    Join Date
    Jul 2007
    Posts
    29
    Vote Rating
    0
    bd318 is on a distinguished road

      0  

    Default


    Now I look closer to your script, you have to change to order of your functions in your script: first create the grid columns, then create the data store. Everything should be fine then!

  6. #6
    Ext User
    Join Date
    Jul 2007
    Posts
    4
    Vote Rating
    0
    Bor is on a distinguished road

      0  

    Default Everything ok, but

    Everything ok, but


    I dind'nt change nothing but i debug the files with firedebug and see, the php file is working fine but only when i click in the dbgrid, if I don't click in the grid , the grid didn't show the data.What's happening.
    Thank you.

Thread Participants: 2

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar