dimanche 28 février 2016

extjs 6 checkbox group getValue

I need to post the values of selected checkboxes in a checkbox group to the server. Ultimately I am not worried about the checkbox name but just the list of input values.

How do I post these to the server? if I use getValue() I get an ext object features, using ext.encode on the object I get this

{"feature-3":"3","cfeature-5":"5","feature-7":"7",
"feature-10":"10","feature-12":"12","feature-13":"13",
"feature-15":"15","feature-18":"18"}

I don't care if the data is parsed before or after the post to the server but I need to be able to loop through the data in php and get 3..5..7 etc as the values when I loop through the data.

what is the best way to send checkboxgroup values to the server? I am using an ajax call like this :

 Ext.Ajax.request({
        scope: this,
        timeout: 1200000,
        url: './data/saveUsedFeatures.php',
        method: 'POST',
        params: {
 features: features
 },

I need to understand how to both send the data and process it in php.




Aucun commentaire:

Enregistrer un commentaire