javascript - How can I bind data (in JSON format) from local database to Kendo UI Scheduler? -


after doing tuts of kendo ui framework, i'm having problems using 1 of widgets. i've basic understanding of framework , first question ever in stackoverflow so... please spare me "advanced" answers if possible.

so, here's thing:

i want use scheduler widget make timeline month view data json file. data (in json format) i'm planning use comes sql server database called on client-side ajax call connects web service. sample:

params.type = 'get'; params.url = 'loremipsum-yeahdomainservice.svc/json/getpeople'; params.datatype = 'json' 

to know if web service working fine, tried retrieve information database kendo dropdownlist , went okay. did script:

var getpeople; getpeople = data.getpeopleresult.rootresults; var listpeople = []; getpeople.foreach(function(person){    var newelement = { 'name': person.name, 'value': i, 'color': '#808080' };    listpeople.push(newelement); }); 

after doing script, used following script:

$("#dropdownlist").kendodropdownlist({   datatextfield: "name",   datavaluefield: "value",   datasource: new kendo.data.datasource ( { listpeople } ) }); 

as planned, got data wanted see in browser.

therefore, want produce script kendo scheduler timeline month view this 1 without "meeting rooms" section , want names of persons called database.

just dropdownlist, doesn't matter if have 30 or 300 person names. persons on scheduler can't static because database updated often. in nutshell, names of persons shown in scheduler must provided dynamically database.

i used multiple scripts kendo ui scheduler documentation scripts widgets based on examples until now, nothing worked out.

based on example provided in kendo ui documentation timeline month view, i've of scripts adapted such as:

datasource: {    batch: true    transport: {       read: {          url: "http://localhost:50379/loremimpsum-yeahdomainservice.svc/json/getpeople",          datatype: "json"  group: {    resources: ["people"],    orientation: "vertical" 

also in relation scheduler script, based on example provided on telerik website did script persons names database. here is:

var result = []; result[0] = { text: "+getpeople[0]+", value: "1", color: "green" }";  for(i=1; i<getpeople.length(); i++){    resultado[i] = ", { text: "+getpeople[i]+"value: "+(i+1)+", color: "green";    i=i+1; }); 

with script in mind, idea call array on resources section of scheduler widget this:

resources: [    {       field: "people",       name: "people",       datasource: [ data: getpeople         ] ] 

any ideas or thoughts?

p.s.

i created script based on kendo documentation using kendo ui dojo , can see see type of view need there.

to whoever may interested in future, found way this. in nutshell, , simple:

resources: [{    field: "name",    name: "people",    datatextfield: "name",    datavaluefield: "name",    datasource: new kendo.data.datasource({       transport: {          read: {             url: "http://localhost:50379/loremimpsum-yeahdomainservice.svc/json/getpeople"          }       },       schema: {          type: "json",          data: "getpeopleresult.rootresults"       }    } ),    multiple: true,    title: "name" }] 

Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -