To clarify, in IE, the servedtable was disabled correctly, but it wasn't reapplied afterwards.
w On Jul 10, 6:12 pm, whatever <[email protected]> wrote: > Hi, Vincent! > I did some testing. the addClass/removeClass didn't quite work, so I > used the setStylesheet: > > To reapply the formatting: > if ( Story.prototype.tEditing_title == tiddler.title && > Story.prototype.tEditing_ndx == tIndex ) { > Story.prototype.tEditing_title = null; > Story.prototype.tEditing_ndx = null; > remove_edit_buttons ( table ); > setStylesheet(".servedtable td:first-child {display: none;}", > "servedtable"); > > And to hide it: > // enable this table for editing > Story.prototype.tEditing_title = tiddler.title; > Story.prototype.tEditing_ndx = tIndex; > setStylesheet(".servedtable td:first-child {display: table-cell;}", > "servedtable"); > prepare_edit_buttons ( table ); > > The strange thing is, that it works in Waterfox/Firefox, but not in > Internet Explorer. I'll try other browsers when I get home. > > w > > On Jul 10, 5:01 pm, Vincent Yeh <[email protected]> wrote: > > > > > > > > > Typo in my last post. The piece of codes you are looking for, W, is > > > var tid = story.getTiddler( Story.prototype.tEditing_title ); > > if ( tid ) { > > var tables = tid.getElementsByTagName("TABLE"); > > if ( tables ) { > > remove_edit_buttons(tables[Story.prototype.tEditing_ndx]); > > addClass ( tables[Story.prototype.tEditing_ndx], 'servedtable' ); > > > } > > } > > > The red text above is probably what you are adding in. > > > V > > > On Tuesday, July 10, 2012 9:49:38 PM UTC+8, Vincent Yeh wrote: > > > > W, > > > > I see, you are missing the table element to restore your servedtable > > > class. You need to go toggleEditMode() function, look for the following > > > piece of codes: > > > > If ( tid ) { > > > var tables = getElementsByTagName("TABLE"); > > > if ( tables ) > > > remove_edit_buttons ( tables[Story.prototype.tEditing_ndx] ); > > > } > > > > Then add your line to the if ( tables ) block as follows: > > > > If ( tid ) { > > > var tables = getElementsByTagName("TABLE"); > > > if ( tables ) { > > > remove_edit_buttons ( tables[Story.prototype.tEditing_ndx] ); > > > addClass ( tables[Story.prototype.tEditing_ndx], 'servedtable' ); > > > } > > > } > > > > I hope this solves your problem :-) > > > > V > > > > whatever 於 2012年7月10日星期二寫道: > > > >> Yes, I know which functions :), and I got it to disable my style, but > > >> I couldn't get it to reenable it. I will take another look though. > > >> Also, since you made the plugin work with the table sorting plugins, > > >> could you maybe import both plugins to your space and set up an > > >> example for each? Like TableEdit--Example, which is nicely showcasing > > >> the functionalities. > > >> w > > > >> On Jul 10, 12:54 pm, Vincent Yeh <[email protected]> wrote: > > >> > W, > > > >> > You can try to put that line of code in remove_edit_buttons(), which is > > >> the > > >> > function to disable the editing features. I planned to rename it to > > >> > stop_editing() or something like that in the next major release. > > > >> > The function to enable editing features is currently > > >> > prepare_edit_buttons(), which shall be renamed as well to > > >> start_editing() > > >> > or something similar. > > > >> > Enjoy! > > > >> > Vincent > > > >> > whatever 於 2012年7月10日星期二寫道: > > > >> > > Hi, Vincent, > > > >> > > This is a kickass plugin that I'm looking forward to using.:D I was > > >> > > wondering one thing, though, does it set some sort of flag or > > >> > > something when in table edit mode? For example, I use a CSS class > > >> > > (servedtable) to hide the first column. Now, I can assign both > > >> > > classes > > >> > > (servedtable and editable) to the table, but I'd like to disable the > > >> > > servedtable class when in table edit mode. I played around with the > > >> > > code a little and found where I can insert a line to disable the > > >> > > servedtable class, but the problem is, it doesn't reenable it after I > > >> > > exit the table edit mode and I'm not sure where to insert a line that > > >> > > would do that. > > > >> > > And ideas how to go about this? > > > >> > > w > > > >> > > On Jul 5, 5:46 pm, Vincent Yeh <[email protected]> wrote: > > >> > > > Craig, > > > >> > > > Do you mean my TableEdit--Example tiddler? I though I made it > > >> private! > > >> > > > Well, I just removed the <<sum...>> macro and made it public, you > > >> can try > > >> > > > it again. > > > >> > > > The <<sum...>> macro is defined in another TableCalculator plugin > > >> which > > >> > > is > > >> > > > under development and not yet released. > > > >> > > > Vincent > > > >> > > > 2012/7/5 Craig in Calgary <[email protected]> > > > >> > > > > Where is the <<sum...>> definition used in your example tiddler? > > > >> > > > > -- > > >> > > > > You received this message because you are subscribed to the > > >> > > > > Google > > >> > > Groups > > >> > > > > "TiddlyWiki" group. > > >> > > > > To view this discussion on the web visit > > >> > > > >https://groups.google.com/d/msg/tiddlywiki/-/emA1IQo6h0MJ. > > >> > > > > To post to this group, send email to [email protected]. > > >> > > > > To unsubscribe from this group, send email to > > >> > > > > [email protected]. > > >> > > > > For more options, visit this group at > > >> > > > >http://groups.google.com/group/tiddlywiki?hl=en. > > > >> > > > -- > > >> > > > Wang-Chi Vincent Yeh, Assistant Professor > > >> > > > Department of Physics, National Dong Hwa University > > >> > > > Tel: 8633719 (O) 8633723 (Lab) > > > >> > > -- > > >> > > You received this message because you are subscribed to the Google > > >> Groups > > >> > > "TiddlyWiki" group. > > >> > > To post to this group, send email to [email protected]. > > >> > > To unsubscribe from this group, send email to > > >> > > [email protected]. > > >> > > For more options, visit this group at > > >> > >http://groups.google.com/group/tiddlywiki?hl=en. > > > >> > -- > > >> > Wang-Chi Vincent Yeh, Assistant Professor > > >> > Department of Physics, National Dong Hwa University > > >> > Tel: 8633719 (O) 8633723 (Lab) > > > >> -- > > >> You received this message because you are subscribed to the Google Groups > > >> "TiddlyWiki" group. > > >> To post to th > > > > -- > > > Wang-Chi Vincent Yeh, Assistant Professor > > > Department of Physics, National Dong Hwa University > > > Tel: 8633719 (O) 8633723 (Lab) -- You received this message because you are subscribed to the Google Groups "TiddlyWiki" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/tiddlywiki?hl=en.

