Seach Box

Seach Box

redhookbakerredhookbaker Posts: 31Questions: 0Answers: 0
edited October 2010 in General
Hi,

I am using ajax to display the table.

When I use

"sDom": 't<"top"lp<"clear">>frt<"bottom"ip<"clear">>',

it does not work. When I use Java Array, it works fine. Thank you

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    In principle it looks fine. What happens when you use it - a JS error?

    Allan
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Actually - you've got 't' twice, which isn't allowed (although I didn't thin it would cause an error...). 't' is the table and you can only have that once (although all other elements can be duplicated).

    Allan
  • redhookbakerredhookbaker Posts: 31Questions: 0Answers: 0
    Hi,

    Thanks for the reply.

    Strangely, it did not show me any error. I am not sure if it has anything to do with the following code I use. thanks








    a
    b
    c
    d
    Final e
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    I've not put any specific code in to catch this situation, so I'm not 100% certain what would happen (without looking at the code), although I had thought that it would just insert the table in the second position. If you have scrolling enabled that might confuse matters I suppose...

    Anyway, did removing the first or second 't' fix the issue?

    Allan
  • redhookbakerredhookbaker Posts: 31Questions: 0Answers: 0
    I dont have luck by removing "t" . This is the code I use, please have a look..it works fine except no search box....thank you

    $(document).ready(function() {
    $('#example').dataTable( {
    "bProcessing": true,
    "bServerSide": true,
    "sDom": 't<"top"lp<"clear">>frt<"bottom"ip<"clear">>',
    "sPaginationType": "full_numbers",
    "bStateSave": true,
    "sAjaxSource": server_processing.asp"
    "fnServerData": function ( sSource, aoData, fnCallback ) {
    aoData.push( { "name": "parm", "value": "<%=Nbr%>" } );
    $.getJSON( sSource, aoData, function (json) {
    fnCallback(json)
    } );
    }

    } );
    } );
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    [code]
    "sAjaxSource": server_processing.asp"
    [/code]
    There is a syntax error there. It's missing a quote mark - which should be giving a JS error really. This seems to work fine for me:

    [code]
    $(document).ready(function() {
    $('#example').dataTable( {
    "bProcessing": true,
    "bServerSide": true,
    "sDom": 't<"top"lp<"clear">>frt<"bottom"ip<"clear">>',
    "sPaginationType": "full_numbers",
    "bStateSave": true,
    "sAjaxSource": "../examples_support/server_processing.php",
    "fnServerData": function ( sSource, aoData, fnCallback ) {
    aoData.push( { "name": "parm", "value": "<%=Nbr%>" } );
    $.getJSON( sSource, aoData, function (json) {
    fnCallback(json)
    } );
    }
    } );
    } );
    [/code]
    The search box is outside of the 'top' div, but that's what sDom says it should do.

    Allan
  • redhookbakerredhookbaker Posts: 31Questions: 0Answers: 0
    sorry to keep bothering you. all the sDom parameters work fine based on this page
    http://datatables.net/usage/options#sDom


    except f, which is for the search input...strange..any ideas? thanks
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    No - no idea I'm afraid. As you can see in this example ( http://datatables.net/examples/advanced_init/dom_multiple_elements.html ) the 'f' option appears to work fine. Can get give us a link please?

    Allan
This discussion has been closed.