2015-06-06 31 views
1

我正在使用MVC Awsome網格,我想隱藏網格的第一列,但努力做和沒有適當的文件在互聯網上,請檢查下面..如何隱藏真棒網格加載後的第一列MVC

@(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) + "'/>"; 
    } 
} 

我已經調用JavaScript函數試圖在Load函數中,但沒有收到,請幫助我的任何人。謝謝

+0

如果你想隱藏第一列,那麼爲什麼要綁定它在第一地點? – ramiramilu

+0

我想要第一列的值並將其作爲參數傳遞,但默認情況下,它不應該對用戶可見,就像隱藏字段 –

+0

向我們展示您的'txtslno'函數?它應該工作,如果你在那裏寫你的自定義CSS。 – ramiramilu

回答