little issue with "sDom" option

little issue with "sDom" option

grobobgrobob Posts: 13Questions: 0Answers: 0
edited March 2009 in Bug reports
Hi Allan,

I try to use the "sDom" option and i found a bug !

"sDom": '<"top"fipl>rt<"bottom"ipl>'

As you can see, i call "i", "p" and "l" twice (i want navigation on top and bottom of the table). It work good, except for "i" which is displayed only at bottom.

Replies

  • grobobgrobob Posts: 13Questions: 0Answers: 0
    oups, found small others things :

    I use alternate paging, then the "top" paging have no "number" part, just the four button first/prev/next/last.
    the "bottom" part have all the right things.

    The number of row selector is not sync between top and bottom : 10 by default, ok
    I change to 25 row on top. The bottom selector stay to 10.

    Theses problems appears only when i display it at top AND bottom at the same time (but i think it could be managed because you use class, not ID)
  • grobobgrobob Posts: 13Questions: 0Answers: 0
    edited March 2009
    i dig into the source code. Not sure you could solve it easilly :'(

    perhaps by using array of oo instead of oo
    ( oSettings.nInfo[0] = nInfo; )

    Hope you could find a nice way
  • zygimantaszygimantas Posts: 33Questions: 0Answers: 0
    It would be great to have couple parameters, lets say, nInfo or nPagination where we can provide JQuery selectors where information should be inserted. Currently and am not a big fan of dynamically added control above or below the table which makes the table change position after it is loaded. I would like to have a statically defined control on any page position.

    Maybe Allan you can provide more information why have you chosen current design or you have any plans to change it later?
  • allanallan Posts: 63,692Questions: 1Answers: 10,500 Site admin
    @grobob: At the moment, each entry in sDom can be specified only once. The reason for this is that DataTables maintains an internal pointer to the required nodes for speed (no need to do a DOM lookup). While it would be nice to have it possible to have multiple instances of each 'block', as you point out this is non-trivial given the current setup. What you could do if you want the paging to be at the top and bottom of a table, is to use a custom paging plug-in which provides this.

    @zygimantas: Yes certainly I can explain the design decisions. There are a couple of reasons:

    1. Progressive enhancement: If the user doesn't have Javascript switched on, then you don't want to have a search box, paging controls extra floating around the page that do nothing. Of course you could implement this all on the server-side as well, but that's a lot of development effort, and I'd be willing to bet that most developers wouldn't do so.

    2. Ease of use: At the moment DataTables requires only that a well formed HTML table be in the DOM. I didn't want to also require that the length changing select menu and all the other controls also be in the DOM - therefore it made sense to add they dynamically as required.

    If you know that they are going to be added, then you can code your CSS and design around this. The idea of sDom for me was that elements which control the table are kept close to the table in the DOM, but provides a wide degree of flexibility to allow visual positioning almost anywhere (using position: relative etc). Also some of the controls can be replicated through the API (filtering for example).

    Hope this explains my design decisions clearly.

    Regards,
    Allan
  • grobobgrobob Posts: 13Questions: 0Answers: 0
    edited March 2009
    no problem, i will display it once, until i understand how to do this with a plugin ;-)

    Thanks for your explaination
  • groovenectargroovenectar Posts: 1Questions: 0Answers: 0
    edited November 2009
    I think the lack of support for multiple "blocks" in sDom is the one issue that will keep us from being able to use DataTables for a particular project :-( Otherwise, I think it's perfect...

    I would imagine it would take a lot of work to implement that functionality, and it might significantly affect performance, but it certainly would be a nice-to-have feature...
  • allanallan Posts: 63,692Questions: 1Answers: 10,500 Site admin
    Hi groovenectar,

    I fully agree - this is really something that I would like to add into DataTables. I don't believe it's a massive amount of work (i.e. it wouldn't need a complete re-write!) to implement, due to the way DataTables is constructed, but on the other hand it is non-trivial. It's just a matter of getting a chance to get the time to spend on implementing this - but it's certainly the next major feature I plan to add.

    Regards,
    Allan
  • pokkapokka Posts: 1Questions: 0Answers: 0
    i just want to find the swf file witch size is 2k )
This discussion has been closed.