PDA

View Full Version : Multiselect combobox post as array



radzik07
10 Nov 2014, 5:42 AM
Hello everyone,
maybe someone know the answer for my problem.

I have a multiselect combobox with name for example: users.
I also have 'users' in my model (type is auto).
Now, when sending the form via PUT or POST, I see in firebug the following key and values:


users 1
users 2
users 3

I can't read it in php, because it's not an array.
I should have something like that:


users[] 1
users[] 2
users[] 3


So, I changed the combobox name to users[] and then PUT/POST works fine,
but model is wrong, because I can't change the name in model to users[] - gives me an error.
Ext always adds the red flag, when a record is changed (edited in form) in a grid. But now, the two names 'users' (in model) and 'users[]' (in view) does not work together with each other.

My ext version is 4.2.1.
Thanks

radzik07
10 Nov 2014, 8:02 AM
I temporarily solved my problem by changing 'params' to 'jsonData' in my ajax call and sending everything as json. It's not a solution to the problem though, just my way around.