Home > Back-end >  JAVA extjs3.0 and SSH
JAVA extjs3.0 and SSH

Time:05-27

I through selectAllForHrcpcorgd () to get the JSON data on how to apply colours to a drawing to EditorGridPanel

Ext onReady (function () {
InitButton ();
Var status=$(" status "). The value;
{if (status=="change")
DealFields ({rd: "data. HRCPCORG_ORGCODE}");
DealFields ({sh: [" btnUpdate ", "btnDelete", "btnCancel"]});
DealFields ({hd: [" btnAddSave ", "btnAdd", "btnChange]"});
Ext getCmp (" separator1 "). SetVisible (false);
Ext getCmp (" separator2 "). SetVisible (false);
} else if (status=="display") {
DealFields ({hd: [" btnAddSave ", "btnUpdate", "btnDelete", "btnCancel"]});
DealFields ({sh: [" btnAdd ", "btnChange]"});
Ext getCmp (" separator2 "). SetVisible (false);
Ext getCmp (" separator3 "). SetVisible (false);
Ext getCmp (" separator4 "). SetVisible (false);
} else if (status=="new") {
DealFields ({wa: "data. HRCPCORG_ORGCODE"});
DealFields ({sh: [" btnAddSave ", "btnCancel"]});
DealFields ({hd: [" btnUpdate ", "btnAdd", "btnDelete", "btnChange", "separator1", "separator3", "separator4]"});
Ext getCmp (" separator1 "). SetVisible (false);
Ext getCmp (" separator3 "). SetVisible (false);
Ext getCmp (" separator4 "). SetVisible (false);
}
BuildGrid2 ();
});
The function buildGrid2 () {
Var huuid1=$(" data. HRCPCORG_UUID "). The value;
//edit the grid
Var kvR=new Ext data. Record. The create ([' key ', 'value']);
Var sm2=new Ext grid. CheckboxSelectionModel ({
SingleSelect: false
});

Var record2=window. Record=Ext data. Record. Create ([' HRCPCORGD_AWARDS '{
Name: 'HRCPCORGD_ACQUISITIONTIME'
Type: 'date',
The dateFormat, Jacqueline Nottingham userDf,
Mapping: 'HRCPCORGD_ACQUISITIONTIME'
} 'HRCPCORGD_ACQUISITIONCAUSE', 'HRCPCORGD_ACQUISITIONREMARK']);

Var store2=window. Store=new Ext. Data store ({
Id: 'store2',
Url: Jacqueline Nottingham. CalUrl (" hr/partyOrganizationDetailDisplay! SelectAllForHrcpcorgd. The action? Huuid1="+ huuid1),
Reader: new Ext data. JsonReader ({
Root: 'columns2'
}, record2)
});


Var columns2=[sm2,
{
Id: 'HRCPCORGD_AWARDS',
Header: 'award',
DataIndex: 'HRCPCORGD_AWARDS',
Width: 200,
Editor: new Ext form. TextField ({})
}, {
Id: 'HRCPCORGD_ACQUISITIONTIME',
Header: 'the winning time,
DataIndex: 'HRCPCORGD_ACQUISITIONTIME',
Width: 220,
Editor: new Ext form. A DateField ({
Format: Jacqueline Nottingham userDf
}),
The renderer: Ext util. Format. DateRenderer (Jacqueline Nottingham. UserDf)
}, {
Id: 'HRCPCORGD_ACQUISITIONCAUSE',
Header: 'for'
DataIndex: 'HRCPCORGD_ACQUISITIONCAUSE',
Width: 220,
Editor: new Ext form. TextField ({})
}, {
Id: 'HRCPCORGD_ACQUISITIONREMARK',
Header: 'remarks',
DataIndex: 'HRCPCORGD_ACQUISITIONREMARK',
Width: 230,
Editor: new Ext form. TextField ({})
}];


Var grid2=window. The grid=new Ext grid. EditorGridPanel ({
Id: 'grid2',
Sm: sm2,
Store: store2,
AutoScroll: true,
Height: 120,
The columns: columns2.
ClicksToEdit: 1,
RenderTo: 'eidt - grid2',
Bbar: new Ext Toolbar ({
AuthWidth: true,
The items: [{
Id: 'addBtn2',
Text: 'add',
Handler: function () {
Store2. Insert (store2. The data. The length, the new record ({
HRCPCORGD_AWARDS: "'
HRCPCORGD_ACQUISITIONTIME: "'
HRCPCORGD_ACQUISITIONCAUSE: "'
HRCPCORGD_ACQUISITIONREMARK: "'
}));
}
}, {
Id: 'removeBtn2',
Text: 'delete',
Handler: function (me, e) {
DoRemove2 ();
}
}
]
})

});
Store2. The load ();

The grid. On (' beforeedit ', function (e) {
The grid. Editev=e;
});

The grid. On (' afteredit ', function (e) {
});
}

The function selectAllForHrcpcorgd () {
Var huuid2=$(" data. HRCPCORG_UUID "). The value;
Ext getBody (). Mask (rs) process, 'X-ray mask - loading');
Ext. Ajax request ({
Url: Jacqueline Nottingham. CalUrl (" hr/partyOrganizationDetailDisplay! SelectAllForHrcpcorgd. The action? Huuid2="+ huuid2),
Params: {},
Method: "POST",
DataType: 'json,
Success: the function (the response, the action) {
Ext getBody (). Unmask ();
Var data=https://bbs.csdn.net/topics/Ext.decode (response. The responseText);
If (data="" https://bbs.csdn.net/topics/={
return;
}
For (var key in the data. The data) {
Var dataToAjax=data. The data [key];
The console. The log (dataToAjax);
}
}
});
}

The function doAddToHrcpcorgd () {
Var huuid3=$(" data. HRCPCORG_UUID "). The value;
Var records2=new Array ();
Var store2=Ext StoreMgr. Lookup (' store2 ');
For (var I=0; i Var data=https://bbs.csdn.net/topics/store2.getAt (I). The data;
Records2. Push (store2. GetAt (I). The data).
}

Ext getBody (). Mask (rs) process, 'X-ray mask - loading');
Ext. Ajax request ({
Url: Jacqueline Nottingham. CalUrl (' hr/partyOrganizationDetailDisplay! DoAddToHrcpcorgd. The action? Hid3='+ huuid3),
Params: {
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related