This is a migrated thread and some comments may be shown as answers.

Grid refreshing and multiple grid open problem

0 Answers 103 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Mahesh
Top achievements
Rank 1
Mahesh asked on 18 Jan 2012, 09:53 AM
I have problem with second grid means gridProperty . It not display data. What is the problem ., Please give me the reply for that .
In this code i pass topic_id to changedatasource ,it takes proper URL when i put gridProperty grid in change function then it display proper data but when i select another row then it display another grid it not refresh that.,display multiple grid.i dont want that display multiple grid ..
var dataSource = new kendo.data.DataSource({
                            transport: {
                                        read: {url:"topics.json",
                                          dataType:"json"}
                                          },
                               schema: {
                                model: {
                                            id: "topic_id",
                                fields: {
                                        TopicID: { type: "string" },                    
                                           name: { type: "string" },
                                        parent_topic_name: { type: "string" },
                                        owner_name: { type: "string" },
                                        description: {type: "string"},
                                            }
                                    }
                                    },
                            pageSize: 8,
                        });
                var selectedTopic;    
                var changedatasource;
$("#grid").kendoGrid({
    dataSource: dataSource,   
    pageable: true,
    sortable: true,
    selectable: true,
    toolbar: kendo.template($("#template").html()),
    columns: ["topic_id", "name","parent_topic_name","owner_name","description"],
    change: function() {
 
         var id = this.select().data("id");
         selectedTopic = this.dataSource.get(id);
        $("#log")
            .html(selectedTopic.get("parent_topic_name") + " > " + selectedTopic.get("name") + "        " +"\
                  Owned By :" +selectedTopic.get("owner_name"));
        $("#desc")
            .html("Description : " + "<br>" +selectedTopic.get("description"));
        $("#tID")
            .html("ID : " + "<br>" +selectedTopic.get("topic_id"));    
             changedatasource = new kendo.data.DataSource({
                        transport: {
                                 read: {url:selectedTopic.get("topic_id")+"/properties.json",
                                  dataType:"json"}
                                },
                               schema: {
                                model: {
                                            id: "topic_property_id",
                                fields: {
                                        topic_property_id: { type: "string" },                    
                                           name: { type: "string" },
                                        data_type: { type: "string" },
                                        sort_order: { type: "number" },
                                        description: {type: "string"},
                                            }
                                    }
                                    },
                            pageSize: 5,
                        });
                    
    }
});
 $("#gridProperty").kendoGrid({
        dataSource:changedatasource,
        height: 250,
        columns: ["name","data_type","sort_order","description"]
     });

No answers yet. Maybe you can help?

Tags
Data Source
Asked by
Mahesh
Top achievements
Rank 1
Share this question
or