I think you just want the default behavior... In the event that you
still need further customization, you can also give submitdata a
function that returns an object hash of additional parameters:
$(...).editable(url, {
...,
submitdata: function(oldValue, settings) {
console.log(this); // 'this' is the element being edited.
var value = "Something dynamic";
return {dynamicParameter: value};
}
});
But again, I think you just want to set the id of the div that you're
making editable.
--Erik
On 6/22/07, Bruce MacKay <[EMAIL PROTECTED]> wrote:
Thanks Erik,
I was kind of hoping that wasn't the form of the solution. Unless
I've interpreted this incorrectly, it seems that the additional
parameter values have to be "hard coded" into the js - which in my
intended use of the plugin is of no use as the editor is designed to
edit any slide the user chooses - it is the id of this "randomly"
chosen slide that I want to hold in the editor and pass to the stream
that goes back to the server with the updated text.
Of course, perhaps I'm wrong and that you can dynamically pass the
"additional param value 1" and the like to the plugin when the submit
button is clicked - if so, how this is done is not immediately apparent to me.
Thanks again for your response/Bruce
At 08:53 p.m. 22/06/2007, you wrote:
>By default, jEditable sends 2 parameters, the ID of the element being
>edited, and the new value.
>If you want to pass along additional data, you can add a parameter
>called "submitdata" and give it a "hash" (key/value object) of
>additional parameters. for example:
>
>$(...).editable(url, {
>...,
>submitdata: {additionalParamName1: "additional param value 1",
>additionParam2: value2}
>});
>
>As an aside, it looks like there's a bunch of new options in the SVN
>version. What's holding up making a "release" of it? I didn't even
>realize there was the SVN version, and it looks like it fixes some of
>the issues that I've had to hack around.
>
>--Erik
>
>On 6/22/07, Bruce MacKay <[EMAIL PROTECTED]> wrote:
>>
>>Hello folks,
>>
>>I'm wanting to incorporate jEditable into a slideshow editor I'm
>>making. I want to be able to pass the ID of the particular slide
>>being edited back to the server at the same time as the edited text.
>>
>>The js source file indicates this is possible, but I don't understand
>>the syntax:
>>
>> * @param Hash options[submitdata] Extra parameters to send when
>>submitting edited content.
>>
>>Can a user help me please?
>>
>>Thanks/Bruce
>>