Author Topic: First use -> first problem  (Read 1547 times)

pquser

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 26
    • View Profile
First use -> first problem
« 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.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6298
    • View Profile
Re: First use -> first problem
« Reply #1 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' }];