/// <summary> /// grid数据设置 /// </summary> /// <returns></returns> public static GridDataAdapterSource GetDataAdapterSource() { var adp = new GridDataAdapterSource(); adp.url = "/griddemo/default/GetListSource";//数据源地址 return(adp); }
/// <summary> /// grid数据设置 /// </summary> /// <returns></returns> public static GridDataAdapterSource GetDataAdapterSource() { var adp = new GridDataAdapterSource(); adp.url = "/griddemo/ColumnsHierarchies/GetListSource";//数据源地址 return(adp); }
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)); }