62,046
社区成员
发帖
与我相关
我的任务
分享
{
xtype: 'radio',
boxLabel: "未登记",
name: 'state1',
id: 'state',
inputValue: 1,
handler: function(i) {
objSampleMethod.GetInfosbyState(i.boxLabel);
}
}, "-", {
xtype: 'radio',
boxLabel: "已登记",
name: 'state1',
inputValue: 2,
handler: function(i) {[code=C#]
[GSPlatform.GETExtension("/sample/getInfosByState.gsp", "application/json", new string[] { })]
public GSPlatform.JSON GetInfosByState(GSPlatform.GSPContext gspcxt)
{
string state = gspcxt.HttpRequest["State"];
string orderBy = gspcxt.QueryString["sort"] + " " + gspcxt.QueryString["dir"] ?? string.Empty;
int pageSize = gspcxt.PagerInfo.PageSize;
int pageIndex = gspcxt.PagerInfo.RequestPage / pageSize + 1;
Page<Sample> page = new SampleRegisterService().GetInfoByState(state, orderBy, pageIndex, pageSize);
gspcxt.PagerInfo.TotalRecords = page.TotalRecords;
return GSPlatform.JSON.Create(page);
}
public Page<Sample> GetInfoByState(string state, string orderBy, int pageIndex, int pageSize)
{
var query = from sample in m_context.Samples.Where(p => p.RegisterStatus == state) select sample;
Page<Sample> page = new Page<Sample>();
page.PageIndex = pageIndex;
page.PageSize = pageSize;
page.List = query.OrderBySql(orderBy).Skip((pageIndex - 1) * pageSize).Take(pageSize).ToList();
page.TotalRecords = query.Count();
return page;
}
this.GetInfosbyState = function(state) {
$.get("sample/getInfosByState.gsp".toGspUrl(), { sid: UserInfo.Sid, State: state.toString(), act: "json" }, function(data) {
//这里要绑定数据
//data是返回来的数据、拿这些数据绑定id.html(data[0]);什么的
});
}
//这个AJAX、实现无刷新效果
this.GetInfosbyState = function(state) {
$.get("sample/getInfosByState.gsp".toGspUrl(), { sid: UserInfo.Sid, State: state.toString(), act: "json" }, function(data) {
objSampleGrid.grid.store.reload();
});
}
objSampleGrid.grid.store.reload();
//这条语句应该是绑定所有的数据吧
//这里是传过去查询
this.GetInfosbyState = function(state) {
$.get("sample/getInfosByState.gsp".toGspUrl(), { sid: UserInfo.Sid, State: state.toString(), act: "json" }, function(data) {
//data是查询以后返回来的结果吧
//你要做的就是怎么把这个返回来的查询数据绑定到EXT:GridCtrl上去
});
}