Copy Code code as follows:
<script type= ' Text/javascript ' >
function Editesorder (options,success,response) {
if (success) {
var tagmodelmanager_maxorderidjson=ext.util.json.decode (Response.responsetext);
var ordervalue = Tagmodelmanager_maxorderidjson.maxorderid;
EXT.GETCMP (' Esorder '). SetValue (OrderValue);
}
}
var tagmodelmanager_toolbar=new ext.toolbar ({
items:[
{ID: ' Tagmodel_save ', text: ' Adding ', iconcls: ' Add ', handler:tagmodel_save}
,'-',
{ID: ' tagmodel_dropselected ', text: ' Delete ', iconcls: ' Remove ', handler:tagmodel_dropselected}
]});
New Ext.grid.GridPanel ({
ID: ' Tagmodelmanager_tagmodelgrid ',
Autoscroll:true, Store:new Ext.data.Store (),
Cm:new Ext.grid.ColumnModel ([New Ext.grid.RowNumberer ()]),
Sm:new Ext.grid.CheckboxSelectionModel (),
Renderto: ' Tagmodelmanager_tagmodeldiv ',
WIDTH:EXT.GETCMP (' Tagmodel_win '). GetSize (). Width-16,
HEIGHT:EXT.GETCMP (' Tagmodel_win '). GetSize (). height-35,
Hideheaders:false,
Loadmask:{msg: ' Loading data, please wait ... '},
Collapsible:true,
Collapsed:false,
Bbar:new Ext.pagingtoolbar ({
ID: ' Tagmodelmanager_tagmodelpagingbar ',
Pagesize:getcombovalue (),
Store:new Ext.data.Store (),
Displayinfo:true
}),
Tbar:tagmodelmanager_toolbar
});
EXT.GETCMP (' Tagmodelmanager_tagmodelgrid '). Render ();
EXT.GETCMP (' Tagmodelmanager_tagmodelgrid '). On (' Rowdblclick ', tagmodelselectrowdblclickevent);
function Tagmodelselectrowdblclickevent (Selectionmodel, RowIndex, Selectedrecord) {
var selectedrows = ext.getcmp (' Tagmodelmanager_tagmodelgrid '). Getselectionmodel (). Getselections ();
var row=selectedrows[0];
Tagmodel_saveoredit (' edit ', row);
}
function Tagmodel_save () {
Tagmodel_saveoredit (' save ');
}
function Tagmodellist_search () {
Ext.Ajax.request ({
URL: ' Edittagmodel.html?method=getparams ',
Callback:getsearchlist
});
}
function Getsearchlist (options,success,response) {
if (success) {
var tagmodelmanager_json=ext.util.json.decode (Response.responsetext);
Tagmodelmanager_tagmodelgridtitle = Tagmodelmanager_json.tagmodelmanager_tagmodelgridtitle;
var record = Tagmodelmanager_json.record;
var tagmodelmanager_tagmodelcolumnmodels = tagmodelmanager_json.tagmodelmanager_tagmodelcolumnmodels;
var tagmodelmanager_tagmodelcolumnmodel=new Ext.grid.ColumnModel (Ext.util.JSON.decode ("[" + "new") Ext.grid.RowNumberer () "+", "+" New Ext.grid.CheckboxSelectionModel () "+", "+tagmodelmanager_tagmodelcolumnmodels+"] "));
Tagmodelmanager_tagmodelcolumnmodel.defaultsortable=true;
var strucutremodelmanager_tagmodeldatastore = new Ext.data.Store ({
Baseparams: {tagModelKeyword:Ext.getCmp (' Tagmodelmanager_search_button '). El.dom.value.trim ()},
Proxy:new Ext.data.HttpProxy ({
URL: ' Edittagmodel.html?method=gettagmodeldatalist '
}),
Reader:new Ext.data.JsonReader ({
Totalproperty: ' resultsize ', Root: ' Tagmodellist '},ext.util.json.decode (Record)});
EXT.GETCMP (' Tagmodelmanager_tagmodelpagingbar '). bind (Strucutremodelmanager_tagmodeldatastore);
Strucutremodelmanager_tagmodeldatastore.load ({Params:{start:0,limit:getcombovalue ()}});
EXT.GETCMP (' Tagmodelmanager_tagmodelgrid '). Settitle (Tagmodelmanager_tagmodelgridtitle);
EXT.GETCMP (' Tagmodelmanager_tagmodelgrid '). Reconfigure (Strucutremodelmanager_tagmodeldatastore,tagmodelmanager _tagmodelcolumnmodel);
EXT.GETCMP (' Tagmodelmanager_tagmodelgrid '). Expand (false);
}
}
function Tagmodellist_all () {
Ext.Ajax.request ({
URL: ' Edittagmodel.html?method=getparams ',
Callback:gettagmodel
});
}
function Gettagmodel (options,success,response) {
if (success) {
var tagmodelmanager_json=ext.util.json.decode (Response.responsetext);
Tagmodelmanager_tagmodelgridtitle = Tagmodelmanager_json.tagmodelmanager_tagmodelgridtitle;
var record = Tagmodelmanager_json.record;
var tagmodelmanager_tagmodelcolumnmodels = tagmodelmanager_json.tagmodelmanager_tagmodelcolumnmodels;
var tagmodelmanager_tagmodelcolumnmodel=new Ext.grid.ColumnModel (Ext.util.JSON.decode ("[" + "new") Ext.grid.RowNumberer () "+", "+" New Ext.grid.CheckboxSelectionModel () "+", "+tagmodelmanager_tagmodelcolumnmodels+"] "));
Tagmodelmanager_tagmodelcolumnmodel.defaultsortable=true;
var strucutremodelmanager_tagmodeldatastore = new Ext.data.Store ({
Proxy:new Ext.data.HttpProxy ({
URL: ' Edittagmodel.html?method=gettagmodeldatalist '
}),
Reader:new Ext.data.JsonReader ({
Totalproperty: ' resultsize ', Root: ' Tagmodellist '},ext.util.json.decode (Record)});
EXT.GETCMP (' Tagmodelmanager_tagmodelpagingbar '). bind (Strucutremodelmanager_tagmodeldatastore);
Strucutremodelmanager_tagmodeldatastore.load ({Params:{start:0,limit:getcombovalue ()}});
EXT.GETCMP (' Tagmodelmanager_tagmodelgrid '). Reconfigure (Strucutremodelmanager_tagmodeldatastore,tagmodelmanager _tagmodelcolumnmodel);
EXT.GETCMP (' Tagmodelmanager_tagmodelgrid '). Expand (false);
}
}
Ext.Ajax.request ({
URL: ' Edittagmodel.html?method=getparams ',
Callback:gettagmodel
});
</script>
public void Gettagmodeldatalist (actionmapping mapping, actionform actionform,httpservletrequest request, HttpServletResponse response) {
Itagmodelmanager tagmgr = This.getpkgserver (). Getdriver (). Getoperateserver (). Gettagmodelmanager ();
listString Tagmodelkeyword = Request.getparameter ("Tagmodelkeyword");
List<esstagmodel> Tagmodels;
Tagmodels = Tagmgr.getesstagmodels ();
int resultsize = 0;
if (null!= tagmodels &&!tagmodels.isempty ()) {
Data Paging display
ResultSize = Tagmodels.size ();
String start = Request.getparameter ("Start");
String perpage = Request.getparameter ("Limit");
String estype = "";
if (null!= start && null!= perpage) {
int fromidx = Integer.parseint (start);
int per = Integer.parseint (perpage);
int toidx = Fromidx + per;
if (Toidx > resultsize) toidx = resultsize;
Tagmodels = Tagmodels.sublist (FROMIDX,TOIDX);
}
for (Esstagmodel etm:tagmodels) {
hashmap<string,string> map = new hashmap<string, string> ();
Map.put ("id", Long.tostring (Etm.getid ()));
Map.put ("Esidentifier", Etm.getesidentifier ());
Map.put ("Estype", Etm.getestype ());
Map.put ("Esdescription", Etm.getesdescription ());
Map.put ("Esorder", Long.tostring (Etm.getesorder ()));
Map.put ("Metadata", Etm.getmetadata ());
Models.add (map);
}
}
Jsonobject json = new Jsonobject ();
Jsonarray ary = new Jsonarray (models);
Json.put ("Tagmodellist", ary);
Json.put ("resultsize", resultsize);
Writejson (response, json.tostring ());
}
public void Getparams (actionmapping mapping, actionform actionform,httpservletrequest request, HttpServletResponse Response) {
linkedhashmap<string,string> tags = new linkedhashmap<string,string> ();
Tags.put ("id", "id");
Tags.put ("Esidentifier", "field");
Tags.put ("Estype", "type");
Tags.put ("Esdescription", "description");
Tags.put ("Esorder", "order");
Tags.put ("Metadata", "meta data");
Tags.put ("Esisnull", "whether is required");
Tags.put ("Eslength", "field length");
Tags.put ("Esdotlength", "Number of decimal places");
Tags.put ("Esissystem", "whether it is a system field");
Jsonobject json = new Jsonobject ();
Json.put ("Record", Getjsonrecord (tags));
Json.put ("Tagmodelmanager_tagmodelcolumnmodels", Getjsoncolumnmodel (tags));
Writejson (Response,json.tostring ());
}