首页 新闻 搜索 专区 学院

tabletree4j 异步加载的例子

0
悬赏园豆:100 [已解决问题] 解决于 2012-06-12 12:07

求一个使用tabletree4j+ ajax异步加载的源代码例子,我邮箱846527149@qq.com,望各位大神指点一下!

SmallMonkey的主页 SmallMonkey | 初学一级 | 园豆:8
提问于:2012-05-24 11:20
< >
分享
最佳答案
1

 

前台:
View Code
后台:
View Code
using System;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using Telerik.Web.UI;
using System.Collections.Generic;
using System.Web.UI.WebControls;

namespace Telerik.TreeListExamplesCSharp.FirstLook
{
    public partial class DefaultCS : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                RadTreeList1.ExpandedIndexes.Add(new TreeListHierarchyIndex { LevelIndex = 0, NestedLevel = 0 });
                RadTreeList1.ExpandedIndexes.Add(new TreeListHierarchyIndex { LevelIndex = 1, NestedLevel = 0 });
                RadTreeList1.ExpandedIndexes.Add(new TreeListHierarchyIndex { LevelIndex = 2, NestedLevel = 0 });
            }
        }
        protected void RadTreeList1_NeedDataSource(object sender, TreeListNeedDataSourceEventArgs e)
        {
            RadTreeList1.DataSource = MyData.GetData();
        } 
        protected void CheckBox1_CheckedChanged(object sender, EventArgs e)
        {
            RadTreeList1.ShowOuterBorders = CheckBox1.Checked;
        }
        protected void CheckBox2_CheckedChanged(object sender, EventArgs e)
        {
            RadTreeList1.ShowTreeLines = CheckBox2.Checked; 
        }
        protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
        {
            switch (DropDownList1.SelectedValue)
            {
                case "Both":
                    RadTreeList1.GridLines = TreeListGridLines.Both;
                    break;
                case "Horizontal":
                    RadTreeList1.GridLines = TreeListGridLines.Horizontal;
                    break;
                case "None":
                    RadTreeList1.GridLines = TreeListGridLines.None;
                    break;
                case "Vertical":
                    RadTreeList1.GridLines = TreeListGridLines.Vertical;
                    break;
            }
        }
        protected void CheckBox3_CheckedChanged(object sender, EventArgs e)
        {
            RadTreeList1.AllowPaging = CheckBox3.Checked;
            RadTreeList1.Rebind();
        }
        protected void CheckBox4_CheckedChanged(object sender, EventArgs e)
        {
            RadTreeList1.AllowSorting = CheckBox4.Checked;
            RadTreeList1.SortExpressions.Clear();
            RadTreeList1.Rebind();
        }
        protected void CheckBox5_CheckedChanged(object sender, EventArgs e)
        {
            RadTreeList1.ClientSettings.Selecting.AllowItemSelection = CheckBox5.Checked;
            RadTreeList1.ClearSelectedItems();
        }
        protected void CheckBox6_CheckedChanged(object sender, EventArgs e)
        {
            RadTreeList1.AllowMultiItemSelection = CheckBox6.Checked;
        }
    }
    public class MyData
    {
        public static List<MyItem> GetData()
        {
            List<MyItem> list = new List<MyItem>();
            list.Add(new MyItem("A", "Appetizers", "", null, true, ""));
            list.Add(new MyItem("B", "Beverages", "", null, true, ""));
            list.Add(new MyItem("C", "Cheese", "", null, false, ""));
            list.Add(new MyItem("A1", "Southwestern Twisted Chips", "150 gr.", 6.79m, false, "A"));
            list.Add(new MyItem("A2", "Top Shelf Combo Appetizer", "300 gr.", 9.49m, true, "A"));
            list.Add(new MyItem("B1", "Sangria", "90 ml.", 6.49m, true, "B"));
            list.Add(new MyItem("B2", "Margarita", "60 ml.", 7.39m, false, "B"));
            list.Add(new MyItem("B3", "Red Cherry Boost", "200 ml.", 6.99m, false, "B"));
            list.Add(new MyItem("B4", "Mojito", "180 ml.", 7.59m, true, "B"));
            list.Add(new MyItem("C1", "Blue Cheese and Hazelnut Shortbread", "220 gr.", 10.69m, false, "C"));
            list.Add(new MyItem("C2", "Avocado Feta Salsa", "240 gr.", 7.19m, false, "C"));
            return list;
        }
    }
    public class MyItem
    {
        public string ID { get; set; }
        public string ProductName { get; set; }
        public string Quantity { get; set; }
        public decimal? Price { get; set; }
        public bool InStock { get; set; }
        public string ParentID { get; set; }
        public MyItem(string id, string productName, string quantity, decimal? price, bool inStock, string parentID)
        {
            ID = id;
            ProductName = productName;
            Quantity = quantity;
            Price = price;
            InStock = inStock;
            ParentID = parentID;
        }
    }
}

 

收获园豆:100
悟行 | 专家六级 |园豆:12429 | 2012-05-24 11:23

这个是花钱的啊,有没有免费的?

SmallMonkey | 园豆:8 (初学一级) | 2012-05-24 11:29

@SmallMonkey: 破解,这是中国,可以做到的。

悟行 | 园豆:12429 (专家六级) | 2012-05-24 11:31

@SmallMonkey: 

http://blog.csdn.net/BlueSuperMan/article/details/3504063这个博客下面有tabletree+ ajax的源码下载。

悟行 | 园豆:12429 (专家六级) | 2012-05-24 11:32

@荒野的呼唤: 那个看不懂唉,有简单点的例子吗?

SmallMonkey | 园豆:8 (初学一级) | 2012-05-24 11:47

@SmallMonkey: http://blog.csdn.net/BlueSuperMan/article/details/3504063这个博客下面有tabletree+ ajax的源码下载。

已经很简单了。把你不需要用的先删除掉,就简单了。

悟行 | 园豆:12429 (专家六级) | 2012-05-24 11:48
其他回答(1)
0

官网不是有异步加载的例子吗?

noside | 园豆:209 (菜鸟二级) | 2012-05-24 16:02

没有找到啊

支持(0) 反对(0) SmallMonkey | 园豆:8 (初学一级) | 2012-05-24 16:59

@SmallMonkey: 在demo/demo_simple_girdtree.html,你看看他“Group B”的写法。另外有个loadingAddNodes方法

支持(0) 反对(0) noside | 园豆:209 (菜鸟二级) | 2012-05-24 18:11
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册