jQWidgets Forums

Forum Replies Created

Viewing 1 post (of 1 total)
  • Author
    Posts
  • in reply to: Initial Pagenum and Pagesize Initial Pagenum and Pagesize #2635

    rondc
    Member

    Peter, thank you for that. I am using the exact same code from your Paging Using MySql and Php example. But nothing is displayed. I did verify via DEBUG that the arrays are being populated from the db but still nothing is displayed, just a blank page. I am at a loss, I do appreciate your help. Here’s my code:

    [DATA.PHP] —————————————————————————————————–
    $row[‘Student Name’],
    ‘ACT-SAT’ => $row[‘ACT-SAT’],
    ‘GPA’ => $row[‘GPA’],
    ‘TRANSFER GPA’ => $row[‘TRANSFER GPA’],
    ‘BIOL100’ => $row[‘BIOL100’],
    ‘HPED’ => $row[‘HPED’]
    );
    }
    $data[] = array(
    ‘TotalRows’ => $total_rows,
    ‘Rows’ => $customers
    );
    echo json_encode($data);
    ?>

    [NURSEDB.HTM] —————————————————————————————————–

    $(document).ready(function () {
    // prepare the data
    var theme = ‘classic’;

    var source =
    {
    datatype: “json”,
    datafields: [
    { name: ‘Student Name’},
    { name: ‘ACT-SAT’},
    { name: ‘GPA’},
    { name: ‘TRANSFER GPA’},
    { name: ‘BIOL100’},
    { name: ‘HPED’}
    ],
    url: ‘data.php’,
    root: ‘Rows’,
    beforeprocessing: function(data)
    {
    source.totalrecords = data[0].TotalRows;
    }
    processdata: function(data)
    {
    data.pagesize = 25;
    }
    };

    var dataadapter = new $.jqx.dataAdapter(source);

    // initialize jqxGrid
    $(“#jqxgrid”).jqxGrid(
    {
    width: 600,
    source: dataadapter,
    theme: theme,
    autoheight: true,
    pageable: true,
    virtualmode: true,
    rendergridrows: function()
    {
    return dataadapter.records;
    },
    columns: [
    { text: ‘Student Name’, datafield: ‘Student Name’, width: 250 },
    { text: ‘ACT-SAT’, datafield: ‘ACT-SAT’, width: 200 },
    { text: ‘GPA’, datafield: ‘GPA’, width: 200 },
    { text: ‘TRANSFER GPA’, datafield: ‘TRANSFER GPA’, width: 180 },
    { text: ‘BIOL100’, datafield: ‘BIOL100’, width: 100 },
    { text: ‘HPED’, datafield: ‘HPED’, width: 140 }
    ]
    });
    });

Viewing 1 post (of 1 total)