PDA

View Full Version : MultiSelect with ItemSelector



Romantik
18 Aug 2009, 3:12 AM
Hi all,

from php I get array of data:
data.php


<?php
echo "[['1', 'One'], ['2', 'Two'], ['5', 'Five']]";
?>


then in ExtJS code I receive the data:


Ext.Ajax.request({
url: 'data.php',
success: function(response) {
Ext.getCmp('uForm').getForm().findField('itemselector').toMultiselect.view.store.loadData(Ext.util.JSON.decode(response.responseText));
}
});


should shows in "to" MultiSelect:

One
Two
Five


but It shows:

1,One
2,Two
5,Five


then if send these data to php script in $_POST array I see:


print_r($_POST);

[data]=> {"itemselector": ",,"}

but shold be
[data]=> {"itemselector": "1,2,5"}


Help me fix this problem. :-/
Thanks