12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- $(function() {
- // 仓库
- $('#warehouseId').combogrid({
- url : WEBROOT + "/loadData.action?entity=warehouse",
- idField : 'warehouseId',
- textField : 'warehouseName',
- delay : 500,
- showHeader : false,
- mode : 'remote',
- columns : [ [ {
- field : 'warehouseName',
- title : '仓库名称',
- width : 150
- } ] ],
- onBeforeLoad : function(param) { // 此设置使控件不会自动加载数据 这里不能使用this
- if (!$('#warehouseId').combogrid('getText')) {
- return false;
- } else {
- return true;
- }
- },
- onShowPanel : function() { // 在第一次触发下拉框事件是加载数据
- if (!$(this).combogrid('getText')) {
- $(this).combogrid({
- onBeforeLoad : function(param) {
- return true;
- }
- });
- }
- }
- });
- // 货主
- $('#customerId').combogrid({
- url : WEBROOT + "/loadData.action?entity=customer",
- idField : 'customerId',
- textField : 'customerName',
- delay : 500,
- mode : 'remote',
- showHeader : false,
- striped : true,
- columns : [ [ {
- field : 'customerName',
- width : 147
- } ] ],
- onBeforeLoad : function(param) {
- // 此设置使控件不会自动加载数据 这里不能使用this
- if (!$("#customerId").combogrid('getText')) {
- return false;
- } else {
- return true;
- }
- },
- onShowPanel : function() {
- // 在第一次触发下拉框事件是加载数据
- if (!$(this).combogrid('getText')) {
- $(this).combogrid({
- onBeforeLoad : function(param) {
- return true;
- }
- });
- }
- }
- });
- // 实例化查询表单,当前页面只能实例化一次
- var searchForm = $("#searchForm").searchForm();
- var advSearchForm = $("#advSearchForm").searchForm();
- // 实例化实体List
- $.InventoryAgeList = new $.AbstractList({
- entity : "Inventory",
- searchForm : searchForm,
- advSearchForm : advSearchForm,
- searchUrl : "/Inventory/inventoryAge.action",
- functionId : functionId,
- showExportButton : true,
- autoLoad:false,
- dataExportUrl:"/Inventory/exportInventoryAgeData.action"
- });
- // 扩展或重写方法
- $.fn.extend($.InventoryAgeList, {
- });
- $("#btnSearch").bind("click", $.proxy($.InventoryAgeList.quickSearch, $.InventoryAgeList));
- $("#btnAdvSearch").bind("click", $.proxy($.InventoryAgeList.openAdvSearchWindow, $.InventoryAgeList));
- $("#btnQuery").bind("click", $.proxy($.InventoryAgeList.advSearch, $.InventoryAgeList));
- $("#btnReset").bind("click", $.proxy($.InventoryAgeList.reset, $.InventoryAgeList));
- });
|