コード例 #1
0
        private static IDictionary <string, object> AppendTreeGridValuesToValuesDictionary(IDictionary <string, object> valuesDictionary, JqGridRecord record)
        {
            JqGridAdjacencyTreeRecord adjacencyTreeRecord = record as JqGridAdjacencyTreeRecord;
            JqGridNestedSetTreeRecord nestedSetTreeRecord = record as JqGridNestedSetTreeRecord;

            if (adjacencyTreeRecord != null)
            {
                valuesDictionary.Add("level", adjacencyTreeRecord.Level);
                valuesDictionary.Add("parent", adjacencyTreeRecord.ParentId);
                valuesDictionary.Add("isLeaf", adjacencyTreeRecord.Leaf);
                valuesDictionary.Add("expanded", adjacencyTreeRecord.Expanded);
            }
            else if (nestedSetTreeRecord != null)
            {
                valuesDictionary.Add("level", nestedSetTreeRecord.Level);
                valuesDictionary.Add("lft", nestedSetTreeRecord.LeftField);
                valuesDictionary.Add("rgt", nestedSetTreeRecord.RightField);
                valuesDictionary.Add("isLeaf", nestedSetTreeRecord.Leaf);
                valuesDictionary.Add("expanded", nestedSetTreeRecord.Expanded);
            }

            return(valuesDictionary);
        }
コード例 #2
0
        private static IList <object> AppendTreeGridValuesToValuesList(IList <object> valuesList, JqGridRecord record)
        {
            JqGridAdjacencyTreeRecord adjacencyTreeRecord = record as JqGridAdjacencyTreeRecord;
            JqGridNestedSetTreeRecord nestedSetTreeRecord = record as JqGridNestedSetTreeRecord;

            if (adjacencyTreeRecord != null)
            {
                valuesList.Add(adjacencyTreeRecord.Level);
                valuesList.Add(adjacencyTreeRecord.ParentId);
                valuesList.Add(adjacencyTreeRecord.Leaf);
                valuesList.Add(adjacencyTreeRecord.Expanded);
            }
            else if (nestedSetTreeRecord != null)
            {
                valuesList.Add(nestedSetTreeRecord.Level);
                valuesList.Add(nestedSetTreeRecord.LeftField);
                valuesList.Add(nestedSetTreeRecord.RightField);
                valuesList.Add(nestedSetTreeRecord.Leaf);
                valuesList.Add(nestedSetTreeRecord.Expanded);
            }

            return(valuesList);
        }