jQWidgets Forums

Forum Replies Created

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • in reply to: Nested Grid manipulation Nested Grid manipulation #8224

    mocchi253
    Member

    Already got the idea how to use the grid filtering and already work
    but my problem now is gathering the data thru json


    var detailsurl = 'customdata.php';
    var source2 = { datafields: [
    { name: 'Territory'},
    { name: 'Region'},
    { name: 'District'},
    { name: 'PSR'},
    { name: 'Cycle_Planned'},
    ],
    datatype: 'json',
    url: detailsurl,
    };

    var ordersDataAdapter = new $.jqx.dataAdapter(source2, { autoBind: true });
    orders = ordersDataAdapter.records;

    var initlevel2 = function (index, parentElement, gridElement, record) {
    // var grid = $($.find('#grid' + index));
    var record = $("#jqxgrid").jqxGrid('getrowdata', index);
    var id = record.uid.toString();
    var grid = $($(parentElement).children()[0]);

    var filtergroup = new $.jqx.filter();
    var filter_or_operator = 1;
    var filtervalue = id;
    var filtercondition = 'contains';

    var filter1 = filtergroup.createfilter('stringfilter', filtervalue, filtercondition);

    // filtergroup.addfilter(filter_or_operator, filter1);
    //----- when add this filter work
    // add and apply the filters.
    // $("#jqxgrid").jqxGrid('addfilter', 'Territory', filtergroup);
    // $("#jqxgrid").jqxGrid('applyfilters');
    //-------------------------------------------------------------------------------------------------------------------------------
    // my problem is here how can I sure if this data evaluate this and passing data cause don't have return value in nested grid
    var ordersbyid = [];
    for (var m = 0; m < orders.length; m++) {
    var result = filter.evaluate(orders[m]['Territory']);
    if (result)
    ordersbyid.push(orders[m]);
    }
    //----------------------------------------------------------------------------------------------------------
    var source2 = { datafields: [
    { name: 'Region'},
    { name: 'District'},
    { name: 'Territory'},
    { name: 'PSR'},
    { name: 'Cycle_Planned'},
    ],
    // url: 'customdata.php',
    // datatype: 'json',
    localdata: ordersbyid,

    }

    if (grid != null) {
    grid.jqxGrid({ source: source2, theme: 'classic', width: 600, height: 200,
    // filterable: true,
    columns: [
    { text: 'Territory', datafield: 'Territory', width: 100 },
    { text: 'Region', datafield: 'Region', width: 100 },
    { text: 'District', datafield: 'District', width: 100 },
    { text: 'PSR', datafield: 'PSR', width: 200 },
    { text: 'Cycle_Planned', datafield: 'Cycle_Planned', width: 200 }
    ]
    });

    }

    }

    in reply to: Nested Grid manipulation Nested Grid manipulation #8202

    mocchi253
    Member

    Hi Dimitar,

    I tried the sample in grid filtering still won’t get the output correct, can you guide me how do it correctly
    I change the value that’s same Territory would be output of each nested grid.

    var initlevel2 = function (index, parentElement, gridElement) {
    // var grid = $($.find('#grid' + index));

    var record = $("#jqxgrid").jqxGrid('getrowdata', index);
    var id = record.uid;
    var grid = $($(parentElement).children()[0]);

    var filtergroup = new $.jqx.filter();

    var filtervalue = id;
    var filtercondition = 'equal';

    var filter1 = filtergroup.createfilter('stringfilter', filtervalue, filtercondition);

    var filter_or_operator = 1;
    filtergroup.addfilter(filter_or_operator, filter1);
    // add the filters.
    $("#jqxgrid").jqxGrid('addfilter', 'Territory', filtergroup);
    // apply the filters.
    $("#jqxgrid").jqxGrid('applyfilters');

    var ordersbyid = [];
    for (var m = 0; m < orders.length; m++) {
    var result = filter.evaluate(orders[m]['Territory']);
    if (result)
    ordersbyid.push(orders[m]);
    }

    var source2 = { datafields: [
    { name: 'Region'},
    { name: 'District'},
    { name: 'Territory'},
    { name: 'PSR'},
    { name: 'Cycle_Planned'},
    ],
    url : 'customdata.php',
    datatype : 'json',
    }

    if (grid != null) {
    grid.jqxGrid({ source: source2, theme: 'classic', width: 600, height: 200,
    filterable: true,
    columns: [
    { text: 'Territory', datafield: 'Territory', width: 100 },
    { text: 'Region', datafield: 'Region', width: 100 },
    { text: 'District', datafield: 'District', width: 100 },
    { text: 'PSR', datafield: 'PSR', width: 200 },
    { text: 'Cycle_Planned', datafield: 'Cycle_Planned', width: 200 }
    ]
    });
    }
    }

    in reply to: Nested Grid manipulation Nested Grid manipulation #8156

    mocchi253
    Member

    Sorry but I’m really confuse about in the example, can you elaborate this part and I already look in documentation but there no part there about in nested grid please help me or explain this part I’m really confuse.

    var initrowdetails = function (index, parentElement, gridElement, record) {
    var id = record.uid.toString();
    var grid = $($(parentElement).children()[0]);
    var filtergroup = new $.jqx.filter();
    var filter_or_operator = 1;
    var filtervalue = id;
    var filtercondition = 'equal';
    var filter = filtergroup.createfilter('stringfilter', filtervalue, filtercondition);
    var ordersbyid = [];
    for (var m = 0; m < orders.length; m++) {
    var result = filter.evaluate(orders[m]["EmployeeID"]);
    if (result)
    ordersbyid.push(orders[m]);
    }

    in reply to: Grid Grouping Question Grid Grouping Question #7328

    mocchi253
    Member

    Ok thanks for the help

    in reply to: Grid Grouping Question Grid Grouping Question #7321

    mocchi253
    Member

    I tried your suggest, thanks and just wondering is there code that can insert in certain row
    sample 1-10 row and then you gonna insert diferent data in row 5 so it will be total of 11row?

    in reply to: Grid Grouping Question Grid Grouping Question #7312

    mocchi253
    Member

    oh thanks for the info, but can you suggest anything about my problem or other way

    in reply to: Grid Grouping Question Grid Grouping Question #7286

    mocchi253
    Member


    does this possible that add subtotal in group in grid


    this is another subtotal of 2nd group and another subtotal for 1st group

Viewing 7 posts - 1 through 7 (of 7 total)