0

I am using Kendo UI- AngularJS, and we have created the iOS mobile application which contains multiple screens(html pages) and for navigating from one html to another html we use "kendo.mobile.application.navigate(test.html);".

We want to pass the JSON object for test.html screen. JSON object contain array of objects. How to pass it?

I know if we want to pass one parameter then we can pass like "kendo.mobile.application.navigate(test.html?name='testName');", But we want to pass the JSON object. How do we achieve it?

RohitK
  • 1,444
  • 1
  • 14
  • 37

2 Answers2

0

You can first stringify your object then pass it as a parameter, for example:

var my_object = {};
my_object.title = "hello";
my_object.price = "15"
window.location.href = "test.html?response=" + JSON.stringify(my_object);

And on the detailed view you can receive this object like this:

//onShow event
function fooShow(e) {
var my_params = JSON.parse(e.view.params.response)
console.log(my_params) 
}
Sarantis Tofas
  • 5,097
  • 1
  • 23
  • 36
0

Don't pass it in URL because of maximum length limitation of a URL

Instead pass plain JSON object in localStorage

Community
  • 1
  • 1