Author Topic: No Rows to Display  (Read 2195 times)

stevejacobsen

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 46
    • View Profile
No Rows to Display
« on: December 18, 2016, 02:17:59 am »
I'm trying to create a new grid and I keep getting No Rows to Display. I've stripped it down to the simplest form, compared it to examples and created a fiddle but can't find the problem.

http://jsfiddle.net/v13n2afj/4/

Quote
$(function () {

    var data = [{id: "1", email: "[email protected]", first_name: "Pancho", last_name: "Jacobsen", password: "password", level: "", activated: "", created: "2016-09-15 10:56:51"}];

// define colModel
    var colM = [
        {
            title: "ID",
            width: 75,
            dataIndx: "id",
            align: "center",
            dataType: "integer"
        },
        {
            title: "Email",
            width: 260,
            dataIndx: "email",
            align: "left",
            dataType: "string"
        },
        {
            title: "First Name",
            width: 260,
            dataIndx: "first_name",
            align: "left",
            dataType: "string"
        },
        {
            title: "Last Name",
            width: 60,
            dataIndx: "last_name",
            align: "left",
            dataType: "string"
        },
        {
            title: "Password",
            width: 75,
            dataIndx: "password",
            align: "left",
            dataType: "string"
        },
        {
            title: "Level",
            width: 60,
            dataIndx: "level",
            align: "center",
            dataType: "string"
        },
        {
            title: "Activated",
            width: 75,
            dataIndx: "activated",
            align: "left",
            dataType: "string"
        },
        {
            title: "Created",
            width: 100,
            dataIndx: "created",
            align: "left",
            dataType: "string"
        }
    ];

    var obj = {
        width: 1150,
        height: 700,
        colModel: colM,
        dataModel: data
    };

    $("#users_grid").pqGrid(obj);
});

stevejacobsen

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 46
    • View Profile
Re: No Rows to Display
« Reply #1 on: December 19, 2016, 08:23:20 pm »
Found it: Changed the dataModel to this:

dataModel: {data: data}