variable visibility

Develop and Deploy Native Apps for Windows, OS X, Linux, Unix ...

variable visibility

Postby tomy300 » Fri Dec 27, 2013 9:24 pm

Hi, Merry Christmass to all of you.

I got a problem with my function "onOk" it a return call from xui.Ajax
I want to add rows to a treegrid, I use ns=this and in my switch I want to add row.
it seem that inside the switch I lost the ns variable. maybe it's a bug??? because it wont append with other languages.
I tried "this" and does't work too.

any clue?

csharp code
onOK: function(response){
ns = this;
switch(response){
case "adddomain":
var stroka=[{"value":"isv", "caption":"clientname", "id":"1"}];
ns.tg_listdomaine.insertRows(stroka);
break;
case "deletedomain":
break;
default:

}
}
tomy300
 
Posts: 70
Joined: Sat Nov 09, 2013 12:27 am

Re: variable visibility

Postby support » Mon Dec 30, 2013 1:40 am

Is your onOK function in Instance?

Here, I guess [this] is the Ajax object.
support
 
Posts: 352
Joined: Sat Apr 27, 2013 9:22 am

Re: variable visibility

Postby tomy300 » Mon Dec 30, 2013 9:00 pm

it's a return function from Ajax yes.

I use a global var window.me = this; in the onready and it's work, I use it a lot everywhere so it's a must.
tomy300
 
Posts: 70
Joined: Sat Nov 09, 2013 12:27 am


Return to CrossUI for Desktop Apps

Who is online

Users browsing this forum: No registered users and 0 guests

cron