ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: pquser on July 07, 2017, 03:07:06 pm

Title: First use -> first problem
Post by: pquser on July 07, 2017, 03:07:06 pm
Hi,

I experimented with paramQuery for the first time and have the following problem:

This code
Code: [Select]
<script>
    $(function () {
        var data = '[{"CashboxName":"Kasse 1"}]';

        var obj = {};
        obj.width = 700;
        obj.height = 400;
        obj.colModel = [{}]
        obj.dataModel = {
            dataType: "JSON",
            data: data
        };
        $('#grid_json').pqGrid(obj);
    });
</script>
<div id="grid_json"></div>

is displayed like in the attachment.
Title: Re: First use -> first problem
Post by: paramvir on July 07, 2017, 04:18:59 pm
dataModel.dataType is used for remote requests.

There shouldn't be quotes around data.

var data = [{"CashboxName":"Kasse 1"}];

and obj.colModel = [ {dataIndx: 'CashboxName' }];