This is a migrated thread and some comments may be shown as answers.

[Solved] args._argument has no length

1 Answer 119 Views
Window
This is a migrated thread and some comments may be shown as answers.
Jeremy Yoder
Top achievements
Rank 1
Jeremy Yoder asked on 22 Dec 2009, 03:43 PM

I like the args variable to use with RadWindow as a dialogbox. Very slick. But I found it has no length value, which I want to use to determine how many argument values I'm returning since it can vary. In the example I'm playing with, rather than assign values by name as your dialog example does below...

oArg.cityName = someValue;
oArg.selDate = someValue;

I'm assigning it like this, which is working fine...

oArg[0] = somevalue;
oArg[1] = somevalue;
oArg[2] = somevalue;

On the return to the parent, all the following can evaulate fine...

args._argument[0]

args._argument[1]

args._argument[2]


But since I don't always know how many arguments I'm returning, I want to reference the length in a loop. However, neither of the following evaluates, but it says they are undefined...

args._argument.length

args.get_argument().length


Any idea why?

1 Answer, 1 is accepted

Sort by
0
Svetlina Anati
Telerik team
answered on 24 Dec 2009, 01:15 PM
Hello Jeremy Yoder,

In order to pass more arguments and to access them in the manner you want I can suggest to choose one of the following approaches:

1) Create a js array object with all your arguments and assign it to the RadWindow's object client argument. After that extract the array and you will be able to access its elements by index.

2) You can concatenate the arguments in one string by adding a special symbol between them. After that you can split the string by using this symbol and you will get an array of the arguments where you can access them by index.

Best wishes,
Svetlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Window
Asked by
Jeremy Yoder
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
Share this question
or