Hi Team,
I want to prepare an observable collection which will be populated from remote resources. I tried so many ways to do so using your web demos and other help but failed in all corner.
Here is what I want to do:
I want to have an observable collection somewhat like:
In above code, both gridSource and cityDataSource will be populated by remote web service which will return data in JSON format.
After that, I want to bind my viewModel to my view.
I tried doing so in so many ways but all in vain.
My web service method looks like:
Although I'm able to populate a single data source using below code:
But when I try to put this datasource inside an observable collection, it fails.
Can you please urgently share complete working code with me on how to achieve the above said functionality? Please share a sample code. This is really urgent and I'm really short of time.
Please please help me.
Thanks,
Shiva
I want to prepare an observable collection which will be populated from remote resources. I tried so many ways to do so using your web demos and other help but failed in all corner.
Here is what I want to do:
I want to have an observable collection somewhat like:
var viewModel = kendo.observable({
gridSource: [
// Grid Data
],
cityDataSource: [
// City dropdown data
]
});
In above code, both gridSource and cityDataSource will be populated by remote web service which will return data in JSON format.
After that, I want to bind my viewModel to my view.
I tried doing so in so many ways but all in vain.
My web service method looks like:
[WebMethod]
[ScriptMethod(ResponseFormat = ResponseFormat.Json)]
public ADVBrokerList[] GetADVBrokerList()
{
try
{
string jsonData = string.Empty;
objService = new SourceDataServices();
ADVBrokerList[] data = objService.GetADVBrokerList();
return data;
}
finally
{
objService = null;
}
}
Although I'm able to populate a single data source using below code:
var dataSource = new kendo.data.DataSource({
transport: {
read: {
// the remote service url
contentType: "application/json; charset=utf-8",
type: "POST",
dataType: "json"
}
}, // -- END OF TRANSPORT
// describe the result format
schema: {
data: "d"
},
change: function () { // subscribe to the CHANGE event of the data source
$("#main").html(kendo.render(template, this.view()));
}
}); // -- END OF DATASOURCE BLOCK
dataSource.read();
But when I try to put this datasource inside an observable collection, it fails.
Can you please urgently share complete working code with me on how to achieve the above said functionality? Please share a sample code. This is really urgent and I'm really short of time.
Please please help me.
Thanks,
Shiva