我正在使用 MVC Awsome 网格,我想隐藏网格的第一列,但是很难做到,并且在互联网上没有适当的文档,请在下面查看..
@(Html.Awe().Grid("MilkClassGrid").Load(false)
.CssClass("keynav")
.Columns(
//new Column { Name = "Count", Width = 100, Header = "Count", ClientFormatFunc = "txtCount"},
new Column { Name = "ID", Width = 100, Header = "", ClientFormatFunc = "txtslno" },
new Column { Name = "MilkClasificatn", Width = 100, Header = "Classification", ClientFormatFunc = "txtClass" },
new Column { Name = "MilkClassDesc", Width = 100, Header = "Description", ClientFormatFunc = "txtDesczzzz" }
// new Column { Name = "Organic", ClientFormatFunc = "toggleButton", Width = 90}
)
.Url(@Url.Action("GetEmptyRecords"))
//.PageSize(100)
.PageSize(5)
.Persistence(Persistence.Session)
.Persistence(Persistence.View) // save collapsed groups and nodes when switching between grid pages
.ColumnsPersistence(Persistence.Session) // save columns (width, grouping, etc..) for browser session lifetime
.Groupable(false)
.Selectable(SelectionType.Single)
.Persistence(Persistence.View)
//.Sortable(true)
.SendColumns(true)
.SingleColumnSort(true)
.Height(300)
.Parent("PageSize", "PageSize")
.Parent("MilkType", "search")
)
已编辑
函数 txtslno(型号,名称){
var as = arryLen.length;
as = parseInt(as) + parseInt(counta);
var val = model[name];
if (!val) val = "";
if (as <= counta) {
counta++;
var html = "<input type='text' class='count11' disabled='disabled' name='" + name + "' id='GetList_" + counta + "_slno' value='" + escapeChars(val) + "'/>";
return html;
} else {
return "<input type='text' class='count11' disabled='disabled' name='" + name + "' id='GetList_" + as + "_slno1' value='" + escapeChars(val) + "'/>";
}
}
我试过在 Load 函数中调用一个 javascript 函数,但没有得到,请任何人帮助我。谢谢