I want to open a window and the data on this window is loaded based on some key on the url, so it’s like $_GET on PHP. how can i achieve this ?
here is the snippet https://snippet.webix.com/6tre8f9l
I want to open a window and the data on this window is loaded based on some key on the url, so it’s like $_GET on PHP. how can i achieve this ?
here is the snippet https://snippet.webix.com/6tre8f9l
if you need to get url query params then check this
Is there anyway we can do this by webix ? and where we supposed to handle this, I mean in which method in a view ?
And when I tried the url something like http://localhost/ptct/webix-old/vcp_v1/#!/app/dashboard?id=7899, webix assumed that dashboard?id=7899 is the name of my view, webix can’t separate them. any suggestions?
I presume you are using Webix Jet with HashRouter.
in this case dashboard
is your view and id
is parameter.
you can access id
using getParam
method of view.
if you are using old version of Jet, try to use :
instead of ?
as parameter separator.
http://localhost/ptct/webix-old/vcp_v1/#!/app/dashboard:id=7899
Hey I really appreciate your help, but please one more thing. How can i use this getParam method ?
I’ve tried several ways, and yes I’m using the old version of webix
$oninit: function (view, scope) {
// I have tried this way
// require(["app"], function (app) {
// app.getParam('id');
// });
// And this way
// this.getParam('id');
// but still the mothod is undefined
},
as far as I remember you can use $onurlchange
method to process url or parameters changing.
{
$onurlchange(params, stack) {
if (params.id) {
...
}
}
}