jQWidgets Forums

jQuery UI Widgets Forums Grid Grid source Custom Function

This topic contains 4 replies, has 2 voices, and was last updated by  Dimitar 11 years, 9 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • Grid source Custom Function #23183

    DavidSimmons
    Participant

    Is there a way to add a custom function “custom” to the source of grid? I will be adding a button to call the custom function.
    var source = {
    datatype: “json”,
    datafields: [
    {name: ‘Title’, type: ‘text’},
    {name: ‘FirstName’, type: ‘text’},
    {name: ‘LastName’, type: ‘text’},
    {name: ‘Phone’, type: ‘text’},
    {name: ‘Email’, type: ‘text’},
    {name: ‘Notes’, type: ‘text’},
    {name: ‘Created’, type: ‘text’},
    {name: ‘CreatedBy’, type: ‘text’},
    {name: ‘Updated’, type: ‘text’},
    {name: ‘UpdatedBy’, type: ‘text’},
    {name: ”}
    ],
    id: ‘ID’,
    url: “../Employee/EmployeeData.php”,
    addrow: function(rowid, commit) {
    },
    deleterow: function(rowid, commit) {
    },
    updaterow: function(rowid, rowdata, commit) {
    },
    sort: function() {
    }
    custom: function() {
    doCustom() //********************
    }
    };

    Grid source Custom Function #23236

    Dimitar
    Participant

    Hello DavidSimmons,

    Yes, you can add a custom function, the source of the grid is a JavaScript object and there is no restriction in adding functions to it.

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

    Grid source Custom Function #23274

    DavidSimmons
    Participant

    Is there some documentation you could point me to on this subject?

    Grid source Custom Function #23277

    DavidSimmons
    Participant

    I think my approach my have been wrong for what I am trying. What I need do is when a button is pressed, pass the sort Object and the Filter Object to a url to create a report.

    Can you tell what the sort and filter objects are I need to pass or is there a better way to do this?

    Button
    var ReportButton = $(“

    “);
    ReportButton.find(‘span’).addClass(‘ui-icon ui-icon-print’);
    ReportButton.width(16);
    ReportButton.jqxTooltip({content: ‘Report!’, position: ‘mouse’, name: ‘Tooltip’, theme: theme});
    ReportButton.appendTo(tableLeft);

    ReportButton.click(function (event) {

    ******* pass sort Object and filter object *******

    });

    Data
    if (isset($_GET[‘insert’])) {

    } else if (isset($_GET[‘update’])) {

    } else if (isset($_GET[‘delete’])) {

    } else if (isset($_GET[‘report’])) {

    ********* Report Do Something *********

    Server side Filtering
    Server side sorting

    ***********************************
    } else if (isset($_GET[‘sortdatafield’])) {

    } else {

    }

    Grid source Custom Function #23293

    Dimitar
    Participant

    Hi DavidSimmons,

    The methods getsortinformation and getfilterinformation return information about the current sorting and filtering and may be useful in your solution.

    On a side note, please format your code in the future by selecting it and pressing the { } icon from the toolbar.

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

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

You must be logged in to reply to this topic.