摘要:
常见的表单布局 var pnForm = new Ext.form.FormPanel({ title:'主体信息', labelAlign: 'right', buttonAlign: 'center', labelWidth: 140, defaults: { autoWidth: true }, padding: 20, fra... 阅读全文
摘要:
表单元素(id必须定义) var txtState = new Ext.form.ComboBox({ fieldLabel: '起运国', id:'txtState', resizable: true, mode: 'local', store: STATENAMEstore, displayField: 'STATENAME', valueField: 'STA... 阅读全文
摘要:
1.首先引用聚合js,css文件 <script src="http://www.cnblogs.com/js/ux/GroupSummary.js" type="text/javascript"></script> <link href="http://www.cnblogs.com/js/ux/css/GroupSummary.css" rel="stylesheet" type="text/css" />2.分组聚合代码如下 var rowNum = n 阅读全文
摘要:
var rowNum = new Ext.grid.RowNumberer({ hidden: false, name: '序号' }); 阅读全文
摘要:
代码如下 var gridArray = new Ext.grid.GridPanel({ title: '选择单据', cm: col, sm: sm, store: store, autoScroll: true, viewConfig: { forceFit: true, columnsText: '显示的列', scrollOffset: 20, sortAscText: '升序', so... 阅读全文
摘要:
记录复选框选中的索引 var sm = gridArray.getSelectionModel(); var rs = sm.getSelections(); var rowIndex=new Array(); rowIndex.clear(); Ext.each(rs, function(item) { rowIndex.push(store.indexOf(item)); }); 这里的索引并非store中的数据而是数据在st... 阅读全文
摘要:
批量对GridPanel添加数据 for(var p=0;p<rs.length;p++) { var record=new Ext.data.Record( { LINENO:rs[p].get("LINENO"), ITEMNO:rs[p].get("ITEMNO"), ITEMNAME:rs[p].get("ITEMNAME"), ... 阅读全文
摘要:
1.添加(设置)单元格样式 function SetMyColumns(value, cell, record, rowIndex, columnIndex, store) { if((columnIndex==9||columnIndex==10)&&gridArray.getStore().getAt(rowIndex).data.ITEMNAME !='总计:') { cell.css = 'x-grid-back-Myellow';//类样式 r... 阅读全文
摘要:
1.定义表单元素的name属性如下 var HLV = new Ext.form.TextField({ fieldLabel: '汇率', name:'EXCHANGERATE', anchor: '30%' });2.定义数据源 var ExchangeRatestore= new Ext.data.Store({ proxy: new Ext.data.HttpProxy({ url: 'WsECOTAX01.asmx/SelectExchangeRate', metho... 阅读全文
摘要:
EditorGridPanel编辑事件以及赋值 var gridArray = new Ext.grid.EditorGridPanel({ title:'', height: 350, id:'gridArray', name:'gridArray', sm:sm, colModel: col, clicksToEdit: 1, st... 阅读全文
摘要:
1.前台js代码var formPanel = new Ext.form.FormPanel({ title: '标识', labelAlign: 'right', buttonAlign: 'center', labelWidth: 80, defaults: { autoWidth: true }, padding: 10, frame: false, border: false, autoScroll: true, fileUpload: true,... 阅读全文
摘要:
代码如下var MygridArray = new Ext.grid.GridPanel({ store: Mystore, cm: Mycm, autoScroll: true, border: false, columnLines:true, viewConfig: { //forceFit:true, columnsText: '显示的列', scrollOffset: 20, sortAscText: '升序', sortDescText: '降序', getRowClass:function(record,row... 阅读全文
摘要:
1.定义全局变量var cmItems = [];var cmConfig = {};2.具体代码思想 从后台请求"列"数据以及store数组,代码如下 gridTemp.removeAll(); cmItems.clear(); var ItemArr = []; var item = {}; UploadstoreColumns.load({ params: {fileName: document.getElementById("txtFile").value} }); for (var a = 0; a < UploadstoreCol... 阅读全文
摘要:
根据选择"状态模块"数据决定"费用状态"中的数据 var dataStatus = [ ['关税增值税', '关税增值税'], ['进出口票状态', '进出口票状态'], ['进出口杂费', '进出口杂费'], ['进出口杂费结算', '进出口杂费结算'], ['进出口代理费', '进出口代理费'], ['进出口代理费结算', '进出口代理费结算'], [' 阅读全文
摘要:
将表单元素禁用txtOwnerPart.setDisabled(true);txtOwnerPart.removeClass('x-form-text');txtOwnerPart.addClass('form_field_readonly');将表单元素启用txtOwnerPart.setDisabled(false);txtOwnerPart.removeClass('form_field_readonly');txtOwnerPart.addClass('x-form-text'); 阅读全文
摘要:
显示txtOtherBuilding.enable();txtOtherBuilding.getEl().up('.x-form-item').setDisplayed(true);隐藏txtOtherBuilding.disable();txtOtherBuilding.getEl().up('.x-form-item').setDisplayed(false); 阅读全文
摘要:
1.代码块View Code var smCompetetor = new Ext.grid.CheckboxSelectionModel({ handleMouseDown: Ext.emptyFn }); var cmCompetetor = new Ext.grid.ColumnModel([ smCompetetor, { header: jsonDataDictionary.labJZDSMC, dataIndex: 'CompetetorName', sortable: true ... 阅读全文
摘要:
代码实现 var sm = new Ext.grid.CheckboxSelectionModel({singleSelect : false,renderer:function(v, p, record) { if (record.get('ITEMNAME') == '总计:'){ return ''; ... 阅读全文
摘要:
1.js代码View Code //grid导出exlfunction outputAddress(grid, strMethod) { try { var xls = new ActiveXObject("Excel.Application"); } catch (e) { alert("要打印该表,您必须安装Excel电子表格软件,同时浏览器须使用“ActiveX 控件”,您的浏览器须允许执行控件。 请点击【帮助】了解浏览器设置方法!"); return; } xls.visible = true; //设置excel... 阅读全文
摘要:
除法函数,用来得到精确的除法结果说明:javascript的除法结果会有误差,在两个浮点数相除的时候会比较明显。这个函数返回较为精确的除法结果。调用:accDiv(arg1,arg2)返回值:arg1除以arg2的精确结果function accDiv(arg1, arg2) { var t1 = 0, t2 = 0, r1, r2; try { t1 = arg1.toString().split(".")[1].length } catch (e) { } try { t2 = arg2.toString().split(".")[1].length 阅读全文