锘??xml version="1.0" encoding="utf-8" standalone="yes"?> var record_store = new Ext.data.Store({ var Grid_Line13 = new Ext.grid.EditorGridPanel({
proxy: new Ext.data.HttpProxy(
{
url: "/aa.ashx",
method: "POST"
}),
reader: new Ext.data.JsonReader(
{
fields: [
"ENTPID",
"UserName",
"PostName",
"Mobile",
"OfficePhone",
"HomePhone",
"Email"
]
})
});
id: "IDHomeGrid",
store: record_store,
clicksToEdit: 1,
columns: [
{ header: '濮撳悕', width: 120, sortable: true, dataIndex: 'UserName', editor: new Ext.form.TextField({ allowBlank: false, blankText: '璇瘋緭鍏ヨ瘎鍒嗛」鐩? }) },
{ header: '鑱屽姟', width: 100, sortable: true, dataIndex: 'PostName', editor: new Ext.form.TextField({ allowBlank: false, blankText: '璇瘋緭鍏ヨ瘎鍒嗛」鐩? }) },
{ header: '鎵嬫満', width: 120, sortable: true, dataIndex: 'Mobile', editor: new Ext.form.TextField({ allowBlank: false, blankText: '璇瘋緭鍏ヨ瘎鍒嗛」鐩? }) },
{ header: '鍔炲叕鐢?shù)璇?', width: 120, sortable: true, dataIndex: 'OfficePhone', editor: new Ext.form.TextField({ allowBlank: false, blankText: '璇瘋緭鍏ヨ瘎鍒嗛」鐩? }) },
{ header: '瀹跺涵鐢?shù)璇?, width: 120, sortable: true, dataIndex: 'HomePhone', editor: new Ext.form.TextField({ allowBlank: false, blankText: '璇瘋緭鍏ヨ瘎鍒嗛」鐩? }) },
{ header: '閭', width: 150, sortable: true, dataIndex: 'Email', editor: new Ext.form.TextField({ allowBlank: false, blankText: '璇瘋緭鍏ヨ瘎鍒嗛」鐩? }) },
{ header: '鍒犻櫎', width: 75, sortable: true, dataIndex: 'ENTPID', renderer: doDeleteAction }
],
stripeRows: true,
height: 500,
width: 800,
stateful: true,
stateId: 'grid',
style: "margin-top:10px"
});
var tempData = Ext.getCmp("cmbSubCompany").getValue();
record_store.load({ params: {action: "SeachLinmanInfo", data: tempData} });
]]>
for錛坴ar i=0;i<row.count();i++錛?br />{
row[i].data.[ID(涓轟綘榪斿洖鍊肩殑瀛楁鍊煎彲浠ラ夋嫨)];
}
]]>
"ID",
"PNAME",
"CID",
"PartID",
"TelNum",
"MobNum",
"Email",
"QQ",
"MSN",
"OtherLink"
];
var MemberStore = new Ext.data.GroupingStore({
proxy: new Ext.data.HttpProxy(
{
url: "Ajax.ashx",
method: "POST"
}),
reader: new Ext.data.JsonReader(
{
fields: MemberField
})
});
MemberStore.load({ params: { action: 'Person' },
callback: function() { }
});
var sm = new Ext.grid.CheckboxSelectionModel({
dataIndex: "CID"
});
var cm = new Ext.grid.ColumnModel([
{ header: "濮撳悕", dataIndex: "PNAME", sortable: true, width: 200, resizable: false },
{ header: "鍏徃", dataIndex: "CID", sortable: true, width: 120, resizable: false },
{ header: "閮ㄩ棬", dataIndex: "PartID", sortable: true, width: 120, resizable: false },
{ header: "鐢?shù)璇?, dataIndex: "TelNum", sortable: true, width: 120, resizable: false },
{ header: "鎵嬫満", dataIndex: "MobNum", sortable: true, width: 500, resizable: false },
{ header: "Email", dataIndex: "Email", sortable: true, width: 60, resizable: false },
{ header: "QQ", dataIndex: "QQ", sortable: true, width: 150, renderer: Funurl, resizable: false },
{ header: "MSN", dataIndex: "MSN", sortable: true, width: 150, renderer: Funurl, resizable: false },
{ header: "鍏朵粬鑱旂郴鏂瑰紡", dataIndex: "OtherLink", sortable: true, width: 150, renderer: Funurl, resizable: false }
]);
function Funurl(value, p, record) {
return "<a href='" + value + "' target='_blank'>" + value + "</a>";
}
var MemberGrid = new Ext.grid.GridPanel({
// title: "鍏徃鍒楄〃",
frame: true,
id: "MemberGrid",
store: MemberStore,
sm: sm,
cm: cm,
clicksToEdit: 1,
autoHeight: true,
tbar: [
{ xtype: "button", text: "鏂板緩", handler: function() { win.show(); } },
{ xtype: "label", html: "|" },
{ xtype: "button", text: "鍒鋒柊", handler: function() {
MemberStore.load({ params: { action: 'Company' },
callback: function() { }
});
}
}
],
bbar: new Ext.PagingToolbar({
store: MemberStore,
pageSize: pageSize,
//鏄劇ず鍙充笅瑙掍俊鎭?br /> displayInfo: true,
displayMsg: '褰撳墠璁板綍 {0} -- {1} 鏉?鍏?{2} 鏉¤褰?,
emptyMsg: "No results to display",
prevText: "涓婁竴欏?,
nextText: "涓嬩竴欏?,
refreshText: "鍒鋒柊",
lastText: "鏈鍚庨〉",
firstText: "絎竴欏?,
beforePageText: "褰撳墠欏?,
afterPageText: "鍏眥0}欏?,
doLoad: function(start) {
// this.store.load({ params: { start: start, limit: this.pageSize, sid: ids, level: nodelevel} }); //杞藉叆
// MemberStore.load({ params: { action: 'GetADMBasicInfo', start: start, limit: pageSize, Type: 8, companyId: units, subCompanyId: corps, departmentId: depts, sectionId: sects, groupId: group, tel: usetel, name: usname, uid: userid} });
}
}),
viewConfig: {
layout: function() {
if (!this.mainBody) {
return; // not rendered
}
var g = this.grid;
var c = g.getGridEl();
var csize = c.getSize(true);
var vw = csize.width;
if (!g.hideHeaders && (vw < 20 || csize.height < 20)) { // display:
// none?
return;
}
if (g.autoHeight) {
if (this.innerHd) {
this.innerHd.style.width = (vw) + 'px';
}
} else {
this.el.setSize(csize.width, csize.height);
var hdHeight = this.mainHd.getHeight();
var vh = csize.height - (hdHeight);
this.scroller.setSize(vw, vh);
if (this.innerHd) {
this.innerHd.style.width = (vw) + 'px';
}
}
if (this.forceFit) {
if (this.lastViewWidth != vw) {
this.fitColumns(false, false);
this.lastViewWidth = vw;
}
} else {
this.autoExpand();
this.syncHeaderScroll();
}
this.onLayout(vw, vh);
}
}
});
}),
]);
榪欎釜鏄痝rid鐨勫垪琛ㄥ瓧孌靛拰鏄劇ず鏂瑰紡
function Funurl(value, p, record) {
return "<a href='" + value + "' target='_blank'>" + value + "</a>";
}
//榪欎釜鏄痝rid璁劇疆
var MemberGrid = new Ext.grid.GridPanel({
renderTo: Ext.getBody(),
title: "鍏徃鍒楄〃",
frame: true,
id: "MemberGrid",
store: MemberStore,
sm: sm,
cm: cm,
clicksToEdit: 1,
autoHeight: true,
tbar: [
{ xtype: "button", text: "鏂板緩", handler: function() { win.show(); } },
{ xtype: "label", html: "|" },
{ xtype: "button", text: "鍒鋒柊", handler: function() { } }
],
viewConfig: {
layout: function() {
if (!this.mainBody) {
return; // not rendered
}
var g = this.grid;
var c = g.getGridEl();
var csize = c.getSize(true);
var vw = csize.width;
if (!g.hideHeaders && (vw < 20 || csize.height < 20)) { // display:
// none?
return;
}
if (g.autoHeight) {
if (this.innerHd) {
this.innerHd.style.width = (vw) + 'px';
}
} else {
this.el.setSize(csize.width, csize.height);
var hdHeight = this.mainHd.getHeight();
var vh = csize.height - (hdHeight);
this.scroller.setSize(vw, vh);
if (this.innerHd) {
this.innerHd.style.width = (vw) + 'px';
}
}
if (this.forceFit) {
if (this.lastViewWidth != vw) {
this.fitColumns(false, false);
this.lastViewWidth = vw;
}
} else {
this.autoExpand();
this.syncHeaderScroll();
}
this.onLayout(vw, vh);
}
}
});
}