Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There is a way to submit additional custom data? #63

Closed
jduval opened this issue Jan 4, 2013 · 4 comments
Closed

There is a way to submit additional custom data? #63

jduval opened this issue Jan 4, 2013 · 4 comments

Comments

@jduval
Copy link

jduval commented Jan 4, 2013

I want to submit data from "editable" table + from "custom" checklist and uploading data.
Is it possible to submit data together ?

example

@vitalets
Copy link
Owner

vitalets commented Jan 4, 2013

Yes, you can use params option defined as function. E.g.

editable({
    ...
    params: function(params) {
        params.checked = ... //get array of checked values
        return params;
    }
});

@jduval
Copy link
Author

jduval commented Jan 4, 2013

I try it, but it fails... seems params are not find. Where should I set params ?

$(".add-mnt").editable(); // here ?

$("#add-mnt-validate").click(function() {
$(".add-mnt").editable('submit', { // or here ?
url: './lib/adh_handler.php',
ajaxOptions: {
dataType: 'json'
},
success: ...
error: ...
});
});

@vitalets
Copy link
Owner

vitalets commented Jan 4, 2013

if you submit each field individually - here:

$(".add-mnt").editable({
    params: ...
}); 

If you submit several fields together - here:

$("#add-mnt-validate").click(function() {
$(".add-mnt").editable('submit', { // or here 
url: './lib/adh_handler.php',
data: {mydata: '123'}, //additional params
ajaxOptions: {
dataType: 'json'
},
success: ...
error: ...
});
});

@jduval
Copy link
Author

jduval commented Jan 4, 2013

cool! thanks for help and your great project!

@jduval jduval closed this as completed Jan 4, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants