or
Hi
I have:
1. The table of the Program of training
2. The table courses
3. Questionnaires ( Of this table is construction CHART)
I want to construct Cascading ComboBox in which selecting programs of training and then courses. After a selection of course, making data from table Questionnaires and construction Chart
How to connect Chart at the first start of page when still it is not known on what identifier to select the data from the table
See my code.
How it to make?
[DataContract] public partial class VMProject : VMRoot { public VMProject() {} public static VMProject GetById(object sender, int id) { return CallGetVMById<VMProject>("", id); } public static VMEntitySet<VMProject> AllVMProjectList(object sender) { return (VMEntitySet<VMProject>)CallGetVMAllList<VMEntitySet<VMProject>>(sender); } [DataMember] public String Name { get { return CallGetData<String>("Name"); } set { CallSetData ("Name", value); } } [DataMember] public VMEntitySet<VMProjectRegel> ProjectRegelList { get { return CallGetData<VMEntitySet<VMProjectRegel>>("ProjectRegelList"); } // set { CallSetData ("ProjectRegelList", value); } } }[DataContract] public partial class VMRoot : Viewmodel { public VMRoot() {} public static VMRoot GetById(object sender, int id) { return CallGetVMById<VMRoot>("", id); } public static VMEntitySet<VMRoot> AllVMRootList(object sender) { return (VMEntitySet<VMRoot>)CallGetVMAllList<VMEntitySet<VMRoot>>(sender); } [DataMember] public Int32 Id { get { return CallGetData<Int32>("Id"); } set { CallSetData ("Id", value); } } [DataMember] public DateTime CreatedOn { get { return CallGetData<DateTime>("CreatedOn"); } set { CallSetData ("CreatedOn", value); } } [DataMember] public Int32 CreatedBy { get { return CallGetData<Int32>("CreatedBy"); } set { CallSetData ("CreatedBy", value); } } [DataMember] public DateTime ChangedOn { get { return CallGetData<DateTime>("ChangedOn"); } set { CallSetData ("ChangedOn", value); } } [DataMember] public Int32 ChangedBy { get { return CallGetData<Int32>("ChangedBy"); } set { CallSetData ("ChangedBy", value); } } } [DataContract] public partial class VMProjectRegel : VMRoot { public VMProjectRegel() {} public static VMProjectRegel GetById(object sender, int id) { return CallGetVMById<VMProjectRegel>("", id); } public static VMEntitySet<VMProjectRegel> AllVMProjectRegelList(object sender) { return (VMEntitySet<VMProjectRegel>)CallGetVMAllList<VMEntitySet<VMProjectRegel>>(sender); } [DataMember] public Int32 Aantal { get { return CallGetData<Int32>("Aantal"); } set { CallSetData ("Aantal", value); } } [DataMember] public Decimal Prijs { get { return CallGetData<Decimal>("Prijs"); } set { CallSetData ("Prijs", value); } } [DataMember] public Decimal BTW { get { return CallGetData<Decimal>("BTW"); } set { CallSetData ("BTW", value); } } }[ { "DatumAanvang": "\/Date(1345732135057+0200)\/", "DatumFaktuur": "\/Date(1345732135059+0200)\/", "Name": "Project onderhoud", "ProjectRegelList": [ { "Aantal": 99, "Prijs": 99.000000000000, "BTW": 1.000000000000, "Id": 101, "CreatedOn": "\/Date(1345732135085+0200)\/", "CreatedBy": 10, "ChangedOn": "\/Date(1345732135085+0200)\/", "ChangedBy": 10 } ], "Id": 1, "CreatedOn": "\/Date(1345732135060+0200)\/", "CreatedBy": 10, "ChangedOn": "\/Date(1345732135060+0200)\/", "ChangedBy": 10 }]var dataSourceprojecten = new kendo.data.DataSource({ // the transport tells the datasource what endpoints // to use for CRUD actions schema: { model: { id: "Id", fields: { DatumAanvang: { type: "date" }, DatumFaktuur: { type: "date" }, Name: { type: "string" }, CreatedOn: { "type": "date" }, CreatedBy: { "type": "number" }, ChangedOn: { "type": "date" }, ChangedBy: { "type": "number" } } } }, transport: { read: { url: "../api/projectonderhoud/get", dataType: "json" } }}); $("#projectregels").kendoGrid( { dataSource: { schema: { model: ProjectRegel }, data: dataSourceprojecten.ProjectRegelList }, groupable: true, sortable: true, pagesize: 10, columns: [ { field: "Id", title: "Id" }, { field: "Aantal", title: "Aantal" }, { field: "Prijs" }, { field: "BTW" }, { field: "CreatedOn", title: "Created on", template: '#= kendo.toString(CreatedOn,"dd MM yyyy") #' }, { field: "CreatedBy" } ] });<div data-role="view" id="foo" data-model="dataSource"> <div data-template="t1" data-bind="source: this"></div></div><script id="t1" type="text/x-kendo-template"> <ul data-auto-bind="false" id="listview" data-role="listview" > <li>aaa</li> <li>bbb</li> </ul></script>// create the grind containing the update elements$("#root_grid").kendoGrid({ dataSource: rootDatasource.read({ params: { active: true } }), columns: [{ field: "id", title: "id", width: 80, }, { field: "name", title: "naam", }, { field: "value", title: "weging", width: 100, }, { field: "active", title: "actief", width: 100, }], toolbar: [{ name: "create", text: "voeg nieuwe rij toe", }, { name: "save", text: "opslaan", }, { name : "cancel", text: "annuleren", }], sortable: true, pageable: { refresh: true, pageSizes: true, messages: i18n.grid.message }, sortable: { mode: "multiple", allowUnsort: true }, editable: true,});var rootDatasource = new kendo.data.DataSource({ schema: { data: "data", model: Root, total: function(response) { return $(response.data).length; } }, pageSize: 10, transport: { read: "/vta/root/all.json", update: { url: "/vta/root/update.json", type: "POST" }, create: { url: "/vta/root/create.json", type: "PUT" }, parameterMap: function (data, operation) { if (operation == "read") { if (data.params != undefined) { var params = new Array(); for (var n in data.params) { params.push(n +"="+ data.params[n]); } return params.join('&'); } } } }, error: function(e) { alert(e.responseText); }, change: function(data) {// console.log(data); }, sort: { field: 'id', dir: 'asc' } });
var Root = kendo.data.Model.define({
id: "id",
fields: {
id: {
editable: false
},
name: {
type: "string",
validation: {
required: true
}
},
'value': {
type: "number",
},
active: {
type: "boolean",
}
},
});