解决方案 »
- Iframe在不同域名下修改父框架src
- 关于将网页设为主页的问题,请高手赐教
- 关于js的两个小问题
- ||问题
- marquee
- 急~~有关框架的问题
- 关于判断值是否为空的疑问
- 太奇怪了!!!快点帮帮我!
- 我的一个窗口msgwin中包含frame1和frame2,frame1的src是1.asp,在1.asp中有一个表单,提交后进入2.asp,现在我想在2.asp中关闭msgwin,该怎
- Vue resource get 跨域请求的加头问题
- The server encountered an internal error () that prevented it from fulfilling t
- 求教Extjs 4 关于Ext.grid.Panel数据显示问题
$("#gene_list").datagrid({
url: "handler/gene.ashx",
idField: "_id", fit: true, fitColumns: true, singleSelect: false, striped: true,
rownumbers: true, nowrap: false, pagination: true, pageSize: 20,
queryParams: ({ method: "get_gene_list", column: column, condition: condition, keyword: keyword }),
pageList: [10, 15, 20, 30, 40, 50],
columns: [[
{ field: "ck", checkbox: true },
{ field: "title", title: "媒体报道标题", width: 30, sortable: true },
{ field: "type", title: "类型", width: 30, sortable: true,
formatter: function (value, rec, index) {
if (value == '1') {
return "媒体报道";
}
else if (value == '2') {
return "基因科普"
}
else if (value == '3') {
return "健康知识"
}
}
},
{ field: "content", title: "内容", width: 30, sortable: true },
{ field: "pic", title: "图片", width: 30, sortable: true },
{ field: "priority", title: "优先级", width: 30, sortable: true },
{ field: "append_time", title: "添加时间", width: 30, sortable: true,
formatter: function (value, rec, index) {
return convert_datetime(value);
}
}
]],
toolbar: [{
text: "添加",
iconCls: "icon-add",
handler: function () {
add_tab(false, "媒体报道数据管理", "html/gene/gene_add.html");
}
}, "-", {
text: "修改",
iconCls: "icon-edit",
handler: function () {
update_gene();
}
}, "-", {
text: '删除',
iconCls: 'icon-remove',
handler: function () {
del_gene();
}
}
]
});
}<div data-options="region:'center',border:false">
<table id="gene_list">
</table>
</div>
public string get_gene_list(HttpContext context)
{
try
{
where _where = new where();
_where.name = "and";
_where.sort = "priority";
_where.order = "-1";
if (context.Request.Params["sort"] != null)
{
_where.sort = context.Request.Params["sort"];
}
if (context.Request.Params["order"] != null)
{
if (context.Request.Params["order"] == "asc")
{
_where.order = "1";
}
else
{
_where.order = "-1";
}
}
_where.int_count = int.Parse(context.Request.Params["rows"]);
_where.int_start = (int.Parse(context.Request["page"]) - 1) * _where.int_count;
string column = context.Request.Params["column"];
string condition = context.Request.Params["condition"];
string keyword = context.Request.Params["keyword"];
List<string> lst_where = new List<string>();
if (condition == "-1")
{
}
else
{
lst_where.Add(column + "," + condition + "," + keyword);
}
_where.and = lst_where;
string json = new JavaScriptSerializer().Serialize(_where);
return jy_gene_dal.get_gene_list(json);
}
catch (Exception e)
{
common.write_log(e.Message + e.StackTrace + e.Source);
return "";
}
}
map.put("total", totalCount); //totalCount: 总的记录数
map.put("rows", userList); // userList: 用dao查询出的结果集合
this.setResult(JSONObject.fromObject(map));在action中导入这两个包
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
private static final long serialVersionUID = -6380432334200957148L; private int total;
private List rows;
private List<Map> footer; public int getTotal() {
return total;
} public void setTotal(int total) {
this.total = total;
} public List getRows() {
return rows;
} public void setRows(List rows) {
this.rows = rows;
} public List<Map> getFooter() {
return footer;
} public void setFooter(List<Map> footer) {
this.footer = footer;
}