예제 #1
0
        public JsonResult GetListSource(GridSearchParams pars)
        {
            if (pars.sortdatafield == null)
            {     //默认按id降序
                pars.sortdatafield = "id";
                pars.sortorder     = "desc";
            }
            Sqlable sable = ls.GetListSqlable();
            var     model = JQXGrid.GetWidgetsSource <list>(sable, pars, "*");//根据grid的参数自动查询

            return(Json(model, JsonRequestBehavior.AllowGet));
        }
예제 #2
0
 public JsonResult DataChild(GridSearchParams pars)
 {
     using (SqlSugarClient db = SugarDao.GetInstance())
     {
         if (pars.sortdatafield == null)
         { //默认按id降序
             pars.sortdatafield = "id";
             pars.sortorder     = "desc";
         }
         Sqlable sable = db.Sqlable().Form <GridTable>("g");                            //查询表的sqlable对象
         var     model = JQXGrid.GetWidgetsSource <Models.GridTable>(sable, pars, "*"); //根据grid的参数自动查询
         return(Json(model, JsonRequestBehavior.AllowGet));
     }
 }
예제 #3
0
        public ActionResult Index()
        {
            var adp = new GridDataAdapterSource();

            adp.url        = "/Grid/Data";
            adp.extendData = "a";
            var gc = new GridConfig();

            gc.gridbuttons = new List <GridButton>()
            {
                new GridButton()
                {
                    click = "add", name = "addbutton", icon = "jqx-icon-plus", title = "添加"
                },
                new GridButton()
                {
                    click = "edit", name = "editbutton", icon = "jqx-icon-edit", title = "编辑"
                },
                new GridButton()
                {
                    click = "del", name = "delbutton", icon = "jqx-icon-delete", title = "删除"
                }
            };
            gc.initRowDetails = "initRowDetails";
            gc.pageSize       = 20;
            gc.width          = "80%";
            gc.filterMode     = FilterModel.advanced;
            gc.selectionMode  = SelectionMode.multipleRows;
            // gc.rowDetails = true;
            gc.columns = new List <GridColumn>()
            {
                new GridColumn()
                {
                    text = "编号", datafield = "id", hidden = true, width = "40px", cellsalign = AlignType.left, datatype = Datatype.dataint
                },
                new GridColumn()
                {
                    text = "名称", datafield = "name", className = "minwidth", width = "200", cellsalign = AlignType.left, datatype = Datatype.datastring, cellsRenderer = "namefun"
                },
                new GridColumn()
                {
                    text = "产品名", datafield = "productname", width = "500px", cellsalign = AlignType.left, datatype = Datatype.datastring
                },
                new GridColumn()
                {
                    text = "数量", datafield = "quantity", cellsalign = AlignType.right, datatype = Datatype.dataint
                },
                new GridColumn()
                {
                    text = "创建时间", datafield = "date", cellsformat = "yyyy-MM-dd", cellsalign = AlignType.right, datatype = Datatype.datadate
                }
            };



            JQXGrid.PublicMehtod.ColumnsPrependCheckbox(gc.columns);
            var grid = JQXGrid.BindGrid("#netgrid", adp, gc);

            ViewBag.validationBind = ValidationSugar.GetBindScript("validate_key_grid_index");
            return(View(grid));
        }
예제 #4
0
 public ActionResult Index()
 {
     ViewBag.Grid = JQXGrid.BindGrid("#grid", CustomCellGridModel.GetDataAdapterSource(), CustomCellGridModel.GetGridConfig());
     return(View());
 }
예제 #5
0
 public ActionResult Index()
 {
     ViewBag.Grid = JQXGrid.BindGrid("#grid", MasterDetailGrid.GetDataAdapterSource(), MasterDetailGrid.GetGridConfig());
     return(View());
 }
예제 #6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     Grid = JQXGrid.BindGrid("#grid", GetDataAdapterSource(), GetGridConfig()).ToString();
 }