jQWidgets Forums

Forum Replies Created

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • in reply to: Grid Colums Header Grid Colums Header #11166

    elias
    Member

    Hi Peter,

    this is the code:

    $(‘#jqxTree’).bind(‘select’, function (event) {

    //$(“.show_hide”).show();
    var fromVar = $(“#from”).val();
    var toVar = $(“#to”).val();

    var dateStringFrom = null;
    var dateStringTo = null;
    var dateString = null;

    if (fromVar.length == 0) {
    alert(“Please Select a Date to Run the report”);
    var newdateObject = new Date();
    dateString = newdateObject.getFullYear() + ‘-‘ + (newdateObject.getMonth() + 1) + ‘-‘ + newdateObject.getDate();
    dateStringFrom = dateString;
    }

    if (fromVar.length > 0 ) {
    var fromVarSql = $(“#from” );
    dateStringFrom = fromVarSql.getFullYear() + ‘-‘ + (fromVarSql.getMonth() + 1) + ‘-‘ + fromVarSql.getDate();
    }

    if (toVar.length > 0) {
    var toVarSql = $(“#to” );
    dateStringTo = toVarSql.getFullYear() + ‘-‘ + (toVarSql.getMonth() + 1) + ‘-‘ + toVarSql.getDate();
    }

    var item = $(‘#jqxTree’).jqxTree(‘getSelectedItem’);
    var reportId = item.parentId;
    var branchId = item.id;

    if (reportId == “1”) {

    var listDocument = ‘ListEodReports’;
    var param = ‘reportId=’ + reportId + ‘&branchId=’ + branchId+’&from=’ + dateStringFrom;

    jQuery.ajax({
    url: listDocument,
    async: false,
    type: ‘POST’,
    data: param,
    error: function(data) {
    alert(data);
    },
    success: function(data) {
    dataGrid = getResultOflistDocument(data);
    }
    });

    eodReport(dataGrid);
    }
    });

    function eodReport (dataGrid) {
    var source =
    {
    datatype: “json”,
    localdata: dataGrid,
    datafields: [
    { name: ‘groupName’},
    { name: ‘contactPersonInitials’},
    { name: ‘contactPersonFirstName’},
    { name: ‘contactPersonLastName’},
    { name: ‘role’},
    { name: ‘groupTotal’}
    ]
    };

    var dataAdapter = new $.jqx.dataAdapter(source, {
    loadComplete: function (dataGrid) { },
    loadError: function (xhr, status, error) { }
    });

    $(“#jqxgrid”).jqxGrid(
    {
    showheader: true,
    pageable: true,
    editable: false,
    columnsresize: true,
    width: ‘70%’,
    source: dataAdapter,
    theme: ‘classic’,
    columns: [
    { text: ‘Group Name’ , datafield: ‘groupName’, width: 200 },
    { text: ‘Contact Initials’ , datafield: ‘contactPersonInitials’, width: 50 },
    { text: ‘Contact First Name’ , datafield: ‘contactPersonFirstName’, width: 100 },
    { text: ‘Contact Last Name’ , datafield: ‘contactPersonLastName’, width: 100 },
    { text: ‘Role’ , datafield: ‘role’, width: 150 },
    { text: ‘Total’ , datafield: ‘groupTotal’, width: 100, cellsalign: ‘right’, cellsformat: ‘D2’ }
    ]
    });
    }

    function getResultOflistDocument(data) {
    dataGrid = data.transactionList;
    return dataGrid;
    }

    the html:

    Select the date range to search for.
    From

    to

    regards
    Elias

    in reply to: Grid Colums Header Grid Colums Header #11164

    elias
    Member

    Hi,

    this is data from the server:

    "[{"id":0,"groupName":"Botanical Society","role":null,"contactPersonLastName":"Green","contactPersonFirstName":"James","contactPersonInitials":"JG","groupTotal":5000.00}]"

    regards
    Elias

    in reply to: Grid Colums Header Grid Colums Header #11160

    elias
    Member

    Hi peter,

    I have changed the data source to:

    var source =
    {
    datatype: “json”,
    localdata: dataGrid,
    datafields: [
    { name: ‘groupName’},
    { name: ‘contactPersonInitials’},
    { name: ‘contactPersonFirstName’},
    { name: ‘contactPersonLastName’},
    { name: ‘role’},
    { name: ‘groupTotal’}
    ]
    };

    It does not display the headers.

    regards
    Elias

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