jeditable

jQuery jeditable trigger on click

南笙酒味 提交于 2019-12-07 15:44:58
问题 I need to use inline edit in my application. For this purpose I am using the Jeditable plugin for jQuery. I want to trigger editable mode for an element only when I click on it. This is my code which doesn't work: var tet = ""; $(".edit-client").click(function(event) { tet = "#"+event.target.id; //alert(tet); }); $(tet).editable("/bestcredit/admin.php/request/editClient", { submitdata : function (value,settings){ return {"Client[id]":'.$model->client->id.' }; }, //indicator : "Saving...", /

jEditable submit on TAB as well as ENTER

不问归期 提交于 2019-12-07 11:12:33
问题 My jEditables work fine as long as the user hits ENTER to leave the input. If the user hits TAB, however, the changes are not posted. This is the correct and documented behavior. I'd like TAB to work just as ENTER does. I don't need to affect any other jEditables, just get the currently active one to post back as if ENTER had been hit. Is there any way to do this short of binding an keydown handler to the jEditable controls? If I do have to provide a keydown handler, is there any way to

Jeditable Async revert on error

妖精的绣舞 提交于 2019-12-07 10:31:20
问题 I have been using the JEditable plugin for JQuery and I would like to return errors to the plugin to instruct it to revert to the previous value and also display an error to the user. I have this working using a synchronous ajax call but I would prefer to use asynchronous callback instead. The code I have to far is below. $("#editbox").editable(submitEdit, { indicator : "Saving...", tooltip : "Click to edit...", name : "Editable.EmailAddress", id : "elementid", type : "text", submit : "<span

Using best_in_place with rich-text editor like TinyMCE

前提是你 提交于 2019-12-07 06:53:54
问题 I'm using the best_in_place gem to do in-place editing in a Rails application. However, I need (X)HTML editing on some of the text areas, so I need a rich-text editor. TinyMCE is being used elsewhere on the site. However, it's not trivial to add an editor to best_in_place . To grossly oversimplify, the gem uses jQuery to insert the textarea tag on the fly, and TinyMCE initializes at page load, replacing available textarea s with an editor, so when best_in_place puts in its textarea , TinyMCE

Jeditable inserts extra spaces around the text in text area

泪湿孤枕 提交于 2019-12-07 01:31:06
问题 Jeditable is inserting extra spaces around the actual text in a text area for me when I click to edit some text. How do I trim this or actually fix this? 回答1: You can actually just pass a function to trim the string you are going to edit. Use this in your settings: data : function(string) {return $.trim(string)}, submit: "Save" 回答2: Found the reason. And it is insane! In place edit will insert space around the text if you html looks like following <div id="inplace_edit_this"> This is some

jeditable dynamic target value

夙愿已清 提交于 2019-12-06 12:05:37
问题 I'm using jeditable and it works really great! I'm just having some trouble figuring out how to dynamically change the target URL. jeditable is bound to a table of values that I want to edit inline. So I have: <td id="<%= col.id %>_<%= i.id %>" class="edit"> The id is a mashup of two values I need to know to edit this item on the server side. My js is: $(document).ready(function() { $('.edit').editable("/items/1", { id : "column_id_item_id", submitdata : function(value, settings){ return {

jEditable: Display Option Text (and not Value) after submit

元气小坏坏 提交于 2019-12-06 07:58:40
问题 I'm using jEditable on a Select list. It works beautifully, except for the following issue. jEditable displays in place whatever a server posts back after a submit. That works great for text boxes etc. where you can simply post the submitted value back from the server. However, this makes no sense on select lists because the value posted is simply the Id of an option element. If I post that back, then my text changes to the Id instead of the friendly text that was there before. How can I turn

how to get to the value of manipulated dom element using _this_ Jeditable?

旧巷老猫 提交于 2019-12-06 06:54:39
问题 This is a Continuation of Jeditable: how to set parameters based on dom element attributes Please respond here.. this is my 'real' account.. I'm trying to assign different parameter values to different divs on which I have enabled the jQuery plugin 'Jeditable'. I can't get it to work, I'm sure its something simple.. but I can't figure it out.. How do I acheive it? Given the following DOM element: <div class="editme" id="theone" rel="test"></div> These various snippets produce the following

jQuery jeditable trigger on click

守給你的承諾、 提交于 2019-12-06 02:47:16
I need to use inline edit in my application. For this purpose I am using the Jeditable plugin for jQuery. I want to trigger editable mode for an element only when I click on it. This is my code which doesn't work: var tet = ""; $(".edit-client").click(function(event) { tet = "#"+event.target.id; //alert(tet); }); $(tet).editable("/bestcredit/admin.php/request/editClient", { submitdata : function (value,settings){ return {"Client[id]":'.$model->client->id.' }; }, //indicator : "Saving...", //tooltip : "Click to edit...", submit : "OK", name : "Client["+tet.substr("1")+"]" //alert(1); }); How

JQuery JEditable stay in edit mode on error

北慕城南 提交于 2019-12-06 02:30:45
I'm successfully using jeditable to submit via a function using jQuery.ajax and the async : false option , but am having an issue aborting if an error is returned. How can I get the edit box to stay activated and / or revert back to the original value if there are errors? I'm returning http status codes. so something like async : false .ajax submit here... if (xhr.status == 200) { return value; else { alert ('returned error'); // keep edit box activated but available for another try, or revert back to original value } I tried not returning a value from the function, which keeps the edit box