This is interesting. I was thinking along these lines but was
interested to know how you - being the designer - would implement it.

Thanks for you help.

I'll tell you what I am working on at the moment. I'd be interested to
know what you thoughts are, if you have any pointers or have thought
about this kind of thing yourself.

I have a sortable "Document History" table for a collaborative
document-writing app (eg the table has columns such as Doc name, last
mod timestamp, last user, link to D/L the doc). There will eventually
be history tables for multiple documents on one page. I am mashing up
your Tablesorter with Remy Sharp's Spy.

What has been interesting so far is:
* reloading all the widgets after an ajax prependage to the table. I
am having trouble deciding the best way to update the widgets this
when the 'update' event is triggered.
* These other widgets bind clicks events to elements in the new table
rows as well as doing things like zebra striping the rows. This makes
the browser go crazy as its trying to handle events and adding rows
all at once.
* The point of mashing other plugins with the tablesorter using the
widget system:- Currently the mashed widget has to be added before the
settings for for said plugin are added to tablesorter. ie

$("table").tablesorter({

widgets: ["mashWidget"],
widgetMashSettings : {
                           url : 'somejson.php',
                           callback : insertJsonIntoTable,
                           timeout : 3000
                          }
});

I haven't even started on resorting the table after rows are added
yet...

This widget thing is so exciting to me. Hopefully it will encourage a
whole load of activity form the community - a widget repository might
be nice!

cheers

Luke

Oh yeah - and I have a plan dynamically loading date parsers based on
locale settings.

On 20 Aug, 23:17, "Christian Bach" <[EMAIL PROTECTED]>
wrote:
> Hi Lukek,
>
> I took an other approach to this.
>
> Check out:http://tablesorter.com/docs/example-extending-defaults.html
>
> Regards
> Christian
>
> 2007/8/20, lukek <[EMAIL PROTECTED]>:
>
>
>
>
>
> > Been having a further poke around.
>
> > I have done what Christian suggested and merged the widgets and parser
> > arrays of this.config with those in settings. However now I have
> > realised the constructor is being called twice - or the number of
> > levels of inheritance.
>
> > So many options not sure what to do...
>
> > On Aug 20, 9:33 am, lukek <[EMAIL PROTECTED]> wrote:
> > > Thanks for getting back Christian - only just seen you post.
>
> > > I look forward to the fix. I will tinker with it and see what I come
> > > up with until then.
>
> > > By the way I had another question. -- In the unpacked version of the
> > > latest script your comment on line 555 says "apply easy methods that
> > > trigger binded events".
>
> > > Does this mean I can insert function calls in here - ie around line
> > > 560?
>
> > > I say this because I have added a call to applyWidget() as I reckon
> > > all the widgets should be reloaded when the update event is triggered
> > > - eg after I insert rows I want to reapply the zebra widget. Unless I
> > > missed something or your plan was to control this action in some other
> > > way.
>
> > > Thanks
>
> > > Luke
>
> > > On Aug 17, 10:36 pm, "Christian Bach" <[EMAIL PROTECTED]>
> > > wrote:
>
> > > > Lukek,
>
> > > > I will supply a fix for this after the weekend. If you cant wait that
> > > > long a tip is that if this.config exists that should be extended
> > > > instead of the defaults. /christian
> > > > 2007/8/17, lukek <[EMAIL PROTECTED]>:
>
> > > > > Hi,
>
> > > > > I have just been playing with the newTablesorter2.0. Thanks Mr Bach!
> > > > > Great piece of work.
>
> > > > > I am having problems getting tables to inherit widgets. I am not
> > sure
> > > > > if its the way $.extend() merges arrays when passing the settings
> > > > > object to thetablesorter.construct() function or what but when I add
> > > > > more widgets it seems to overwrite the ones I added previously.
>
> > > > > EXAMPLE:
>
> > > > > <table class="data" id="myTable1"> ...</table>
>
> > > > > <table class="data" id="myTable2"> ...</table>
>
> > > > > <script>
>
> > > > > $("table.data").tablesorter( { widgets: [ 'zebra', 'someWidget',
> > > > > 'anotherWidget'] } );
>
> > > > > $("#myTable2").tablesorter( { widgets: [ 'completelyDiffWidget' ] }
> > );
>
> > > > > </script>
>
> > > > > Do you see what I'm doing? "#myTable2" should now have all four
> > > > > widgets.
>
> > > > > But that's not what happens.
>
> > > > > Can anyone kindle point me in the right direction
>
> > > > > cheers
>
> > > > > Luke- Hide quoted text -
>
> - Show quoted text -

Reply via email to