daily pastebin goal
89%
SHARE
TWEET

ejQuery filter remote

a guest Aug 9th, 2016 22 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var dateCriteriaChange = function (startDate, endDate) {
  2.                 var dataManager = ej.DataManager({ url: "/LoanApplicationQuery/List", adaptor: new ej.UrlAdaptor() });
  3.  
  4.                 var rangeQuery = ej.Query()
  5.                     .where("ProviderId", ej.FilterOperators.equal, 62)
  6.                     .where("FundingDate", ej.FilterOperators.greaterThanOrEqual, startDate)
  7.                     .where("FundingDate", ej.FilterOperators.lessThan, endDate);
  8.  
  9.                 $("#grid").ejGrid({
  10.                     dataSource: dataManager,
  11.                     query: rangeQuery,
  12.                     allowResizing: true,
  13.                     allowPaging: true,
  14.                     allowSorting: true,
  15.                     allowReordering: true,
  16.                     allowSelection: false,
  17.                     enablePersistence: false,
  18.                     allowTextWrap: true,
  19.                     pageSettings: { pageSize: 10, pageCount: 10 },
  20.                     sortSettings: { sortedColumns: [{ field: "FundingDate", direction: "descending" }] },
  21.                     toolbarSettings: { showToolbar: true, toolbarItems: [ej.Grid.ToolBarItems.ExcelExport] },
  22.                     columns: [
  23.                         { field: "LoanTransactionNumber", type: "string", headerText: "Loan Number" },
  24.                         { field: "FundingDate", type: "date", format: "{0:MM/dd/yyyy}", headerText: "Funding Date" },
  25.                         { field: "Office", type: "string", headerText: "Location" },
  26.                         { field: "FirstName", type: "string", headerText: "First Name" },
  27.                         { field: "LastName", type: "string", headerText: "Last Name" },
  28.                         { field: "SaleAmount", type: "number", format: "{0:c}", headerText: "Amount Financed", textAlign: "right" },
  29.                         { field: "MDF", type: "number", format: "{0:p}", headerText: "Discount Rate", textAlign: "right" },
  30.                         { field: "DiscountFee", type: "number", format: "{0:c}", headerText: "Discount Amount", textAlign: "right" },
  31.                         { field: "NetFunded", type: "number", format: "{0:c}", headerText: "Net Funded Amount", textAlign: "right" }
  32.                     ],
  33.                     toolbarClick: function (e) {
  34.                         this.exportGrid = this["export"];
  35.                         if (e.itemName == "Excel Export") {
  36.                             this.exportGrid('/LoanApplicationQuery/Export')
  37.                             e.cancel = true;
  38.                         }
  39.                     }
  40.                 });
  41.             };
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top