Home:ALL Converter>how to pass parameters to modal popup?

how to pass parameters to modal popup?

Ask Time:2016-08-20T13:46:16         Author:Hardik Vaghani

Json Formatter

I am working on Nativescript application where i need to open view on click of list item. So i will have to pass id of that item to the modal that is about to open on click of list item.

Here is my code as i tried and for opening modal popup :

var modalPageModule = views.appointmentDetails;
var context = {
  id: args.view.bookingId // i tried this way for passing parameter
};
var fullscreen = true;
page.showModal(modalPageModule, context, function closeCallback(parameters) {
 // Log the user in...

}, fullscreen);

And code for getting passed parameter on controller of modal popup

page = args.object;
var gotData = page.navigationContext;
var id = gotData.id;

But returns NaN.

Please suggest some way to pass variable to modal popup.

Author:Hardik Vaghani,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/39050898/how-to-pass-parameters-to-modal-popup
yy