Tags:
create new tag
view all tags

Question

One of the Wish List items for Plugins.EditTablePlugin is to be able to specify putting the "Edit" button at the top.

One of my users just requested this today.

Has anyone come up with a workaround, probably in HTML forms and/or JavaScript, to implement this?

Environment

TWiki version: unspecified
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS:  
Web server:  
Perl version:  
Client OS:  
Web Browser:  
Categories:  

-- VickiBrown - 26 Feb 2008

Answer

ALERT! If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.

This is a script that uses BehaviourContrib (installed by default). It assumes you know the name of the form (edittable1).

<script type="text/javascript">
var rules = {
   '.editTableEditImageButton' : function(el) {
      var clone = el.cloneNode(false);
      var ettablenrEl = document.forms.edittable1.ettablenr;
      ettablenrEl.parentNode.insertBefore(clone, ettablenrEl);
      clone.style.marginBottom = '2px';
      el.parentNode.removeChild(el);
   }
};
Behaviour.register(rules);
</script>

-- ArthurClemens - 26 Feb 2008

That works great (when we have one table). Of course, if we have two tables, it puts two buttons at the top of edittable1.

I thought I'd re-open this while I flail around on the code... perhaps someone with more JavaScript experience will te pity on me and help me to extend this script to handle more than one table on a page.

-- VickiBrown - 13 Oct 2008

This can be a workaround with no need for javascript. But for some causes I can not figure out in this TWiki installation the edition in one table modifies de button on the other. On my local intranet it works well with TWiki-4.2.0.


%EDITTABLE{  }% 
| %EDITCELL{ "editbutton, 1, Edit this table" }% ||
| *Header1* | *Header 2* | 
| Blah, blah | blah, blah, blah |
| Blah, blah | blah, blah, blah |


%EDITTABLE{  }% 
| %EDITCELL{ "editbutton, 1, Edit this other table" }% ||
| *Header 3* | *Header 4* | 
| Blah, blah | blah, blah, blah |
| Blah, blah | blah, blah, blah |

Header1 Header 2
Blah, blah blah, test, blah
Blah, blah blah, blah, blah

Header 3 Header 4
Blah, blah blah, blah, blah
Blah, blah blah, blah, test

-- EnriqueCadalso - 14 Oct 2008

Fixed

-- ArthurClemens - 02 Nov 2008

This is now in twiki.org's SVN, TWikibug:Item6062. Thanks ArthurClemens.

-- PeterThoeny - 03 Nov 2008

Change status to:
Edit | Attach | Watch | Print version | History: r7 < r6 < r5 < r4 < r3 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r7 - 2008-11-22 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.