Пример #1
0
 private string GetColModel(JQGrid grid)
 {
     Hashtable[] hashtableArray = new Hashtable[grid.Columns.Count];
     for (int i = 0; i < grid.Columns.Count; i++)
     {
         JsonColModel model = new JsonColModel(grid.Columns[i], grid);
         hashtableArray[i] = model.JsonValues;
     }
     return JsonColModel.RemoveQuotesForJavaScriptMethods(new JavaScriptSerializer().Serialize(hashtableArray), grid);
 }
Пример #2
0
        private string GetColModel(JQGrid grid)
        {
            Hashtable[] array = new Hashtable[grid.Columns.Count];
            for (int i = 0; i < grid.Columns.Count; i++)
            {
                JsonColModel jsonColModel = new JsonColModel(grid.Columns[i], grid);
                array[i] = jsonColModel.JsonValues;
            }
            string input = new JavaScriptSerializer().Serialize(array);

            return(JsonColModel.RemoveQuotesForJavaScriptMethods(input, grid));
        }
Пример #3
0
        private string GetColModel(JQGrid grid)
        {
            List <string> lTreeGridColumn = new List <string>();

            lTreeGridColumn.Add("level");
            lTreeGridColumn.Add("parent_id");
            lTreeGridColumn.Add("isLeaf");
            lTreeGridColumn.Add("expanded");

            grid.Columns.RemoveAll(g => lTreeGridColumn.Contains(g.DataField));
            Hashtable[] hashtableArray = new Hashtable[grid.Columns.Count];
            for (int i = 0; i < grid.Columns.Count; i++)
            {
                //if (lTreeGridColumn.Contains(grid.Columns[i].DataField)) continue;
                JsonColModel model = new JsonColModel(grid.Columns[i], grid);
                hashtableArray[i] = model.JsonValues;
            }
            return(JsonColModel.RemoveQuotesForJavaScriptMethods(new JavaScriptSerializer().Serialize(hashtableArray), grid));
        }