Start a new topic
Solved

Anonymouse object DONT work if defined inside an action

the following code snippet show me trying to do an Alert Message Box from inside

the callback of and Config Message Box:


Webix.confirm(new {
title = "Custom title",
ok = "Yes",
cancel = "No",
type = "confirm-error",
text = "Test confirm",
callback = new Action<object>(result => {
var tester = new { title = "TEST TITLE", text = "TEST ALERT MESSAGE" };
Webix.alert(tester);
})


the line:


var tester = new { title = "TEST TITLE", text = "TEST ALERT MESSAGE" };


gives a error: TypeError: Cannot read property 'ctor' of undefined


now if i either MOVE the var tester = new { title = "TEST TITLE", text = "TEST ALERT MESSAGE" };


to OUTSIDE of the Action<> BEFORE the confirm it works Fine.


ALSO if i wrap in a Js.@object() then it works INSIDE the action:


Js.@object(var tester = new { title = "TEST TITLE", text = "TEST ALERT MESSAGE" });


BUT I DONT WANNA HAVE TO PREFIX ALL MY ANONYMOUSE OBJECTS WITH

Js.@object()


ALSO NOTE: It only gives error if you do a 'new {}' INSIDE AN Action (So far... that is all i encountered the problem)

1 Comment

We fixed this issue iv the coming v1.1, the problem was with nested anonymous classes.


See: http://support.duoco.de/support/discussions/topics/5000051289

Login or Signup to post a comment