jQWidgets Forums

Forum Replies Created

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts

  • bart
    Member

    Hi Peter,

    Now it works perfect – thanks for your help.


    bart
    Member

    Ok, I think, I found a problem…
    …depends on data I am trying to display.

    NIP value sometimes can be written with and sometimes without sign “-“, eg. “8791312383”, or “879-131-23-83”.
    What is strange, until json file contains no strings with “-” signs, everything seems to work. As soon as I insert at least 1 string with “-” sign, JS error occurs.


    bart
    Member

    Hi Peter,

    The problem is that in your code all works fine, but if you change localdata to external url then error occurs.
    The very strange for me is that the grid contains 4 text columns with 4 text filters; 3 works fine and only the 4th generates error.


    bart
    Member

    Hi Peter,

    The checkbox column is fine now.
    Unfortunatelly, the strange TypeError: x is null error still exists. Do you have any ide what can be the reason?


    bart
    Member

    Hi Peter,

    Works perfect.

    Thanks


    bart
    Member

    Hi Peter,

    datafields definition as bool helped (checkbox rendering is fine now), however filter row still doesn’t work as I would expect:
    TypeError: s.filter.getfilters()[0] is undefined
    for checkbox filter
    and
    TypeError: x is null
    for NIP column filter (see code below)

    var sWidth = $(window).width()-40;
    var url = "ajax/companies_functions.php?f_case=1";
    var getAdapter = function() {
    var source =
    {
    datatype: "json",
    datafields: [
    { name: 'ID' },
    { name: 'Name' },
    { name: 'Street' },
    { name: 'City' },
    { name: 'NIP' },
    { name: 'Recipient', type: 'bool' },
    { name: 'Supplier', type: 'bool' }
    ],
    id: 'id',
    url: url,
    root: 'data'
    };
    var dataAdapter = new $.jqx.dataAdapter(source);
    return dataAdapter;
    }
    $("#companies").jqxGrid({
    width: sWidth,
    source: getAdapter(),
    theme: theme,
    sortable: true,
    columnsresize: true,
    showstatusbar: true,
    filterable: true,
    showfilterrow: true,
    autoshowfiltericon: true,
    ready: function () {
    $("#companies").jqxGrid('hidecolumn', 'ID');
    },
    columns: [
    { text: 'ID', datafield: 'ID', columntype: 'textbox', width: sWidth*0.05 },
    { text: 'Company name', datafield: 'Name', columntype: 'textbox', width: sWidth*0.4 },
    { text: 'Address', datafield: 'Street', columntype: 'textbox', width: sWidth*0.3 },
    { text: 'City', datafield: 'City', columntype: 'textbox', width: sWidth*0.15 },
    { text: 'VAT number', datafield: 'NIP', columntype: 'textbox', width: sWidth*0.08, cellsalign: 'center' },
    { text: 'Rec', datafield: 'Recipient', type: 'bool', columntype: 'checkbox', filtertype: 'bool', width: sWidth*0.029 },
    { text: 'Sup', datafield: 'Supplier', type: 'bool', columntype: 'checkbox', filtertype: 'bool', width: sWidth*0.029 }
    ]
    });
    $("#companies").bind('bindingcomplete', function () { localiseGrid("companies"); });
Viewing 6 posts - 1 through 6 (of 6 total)