adgfs
adgfs

Reputation: 423

Split string using Dojo/Dijit

Here is my problem,

I have a dojo/dijit multiselect list, so after a multiple select i need to split the result

Example

 var selecteted = dijit.byId('list1').attr('value');

let assume that selected = 'value 1,value2,value3';

so afer i have multiple result i do as follow in order to split it

var splited = new Array();
splited = selected.split(',');

but this code failed, for some reason the 'selected' variable is some dojo/dijit object which is not compatible with java script 'split' ...

so i m wondering , is dojo has their own split implementation ? also i would be glad to share me your opinios..

Thanks

EDIT

After a litle debug with Firebug i found out that 'selected' format is array, so actualy split is not necessary anymore.

Upvotes: 1

Views: 3059

Answers (1)

hugomg
hugomg

Reputation: 69934

dijit.form.Multiselect already gives an array (of selected stuff) when you get its value property. There is no need to do a split.

Upvotes: 1

Related Questions