Customize the select box

Customize the select box

SellesSelles Posts: 32Questions: 0Answers: 0
edited November 2009 in General
Hi Allan,

I've downloaded v1.5.4. Looks great, again!!!!!!

I've a question about customizing the selectbox with te lengthoptions. I found this post: http://datatables.net/forums/comments.php?DiscussionID=369&page=1#Item_2,

but it won't work. Is there an other way to handle this?

Tnx

Greatings

Wim

Replies

  • allanallan Posts: 61,822Questions: 1Answers: 10,127 Site admin
    Hi Wim,

    There is an example in the documentation of how to do this: http://datatables.net/usage/i18n#oLanguage.sLengthMenu (which I think is more or less the same as in the post you linked to - in what why won't it work?). Remember if you remove the default '10' you need to change 'iDisplayLength' as well, since that is default 10.

    Regards,
    Allan
  • SellesSelles Posts: 32Questions: 0Answers: 0
    Hi Allan,

    I took a good look at the example and saw that I wasn't doing anything wrong. But I found out what the problem was. I also set the language to Dutch, like this. But that overrules the sLengthMenu. Is there an other way to change the length?

    Grtzzz

    Wim

    [code]
    oTable = $("#edit_vacancy_table").dataTable({
    "aaSorting": [[ 7, "desc" ]],
    "iDisplayLength": 5,
    "oLanguage": {"sLengthMenu":
    'Display '+
    '5'+
    '10'+
    '20'+
    'Alles'+
    ' records',
    "sUrl": "js/intranet/jquery.dataTables.dutch.txt"},
    "aoColumns": [
    /* vacancy_id */ {"bVisible" : false },
    /* referentie */ null,
    /* functie */ {"sType" : "html"},
    /* expertise */ {"sType" : "html"},
    /* internet */ {"sWidth" : "84px"},
    /* startdatum */ {"sWidth" : "115px"},
    /* duur */ {"sWidth" : "90px"},
    /* geplaatst op */ {"sType" : "uk_date",
    "sWidth" : "125px"}
    ]
    });
    [/code]
  • allanallan Posts: 61,822Questions: 1Answers: 10,127 Site admin
    Hi Wim,

    I think the easiest way would be to alter the dutch.txt file to have the menu you want in it. Otherwise you are going to have Dutch text, everywhere apart from the "Display X records" at the moment!

    Regards,
    Allan
This discussion has been closed.