Trying to search in the columns where existis tags DIV

Trying to search in the columns where existis tags DIV

alissonxalissonx Posts: 25Questions: 0Answers: 0
edited March 2011 in Bug reports
Hi.. I don't know if this is an error...

but in my table(using datatable), I have some buttons when clicked calls div tags where I have actions to 'edit,remove' a record.

but... when I tried to use the search(bFilter:true) input returns nothing. And the "search string" is on the text on the table;

somebody can help me?

Replies

  • alissonxalissonx Posts: 25Questions: 0Answers: 0
    always I use DIV tags hello

    inside dataTable, the Search don't work...
  • allanallan Posts: 63,552Questions: 1Answers: 10,477 Site admin
    Could you show us the code that you are using please? I think we might need a little more to go on :-)

    Allan
  • alissonxalissonx Posts: 25Questions: 0Answers: 0
    let me explain...

    i'm using data table.

    on the first column I have the "ID" of ticket.(its a table ticket).

    when I use the action "on mouse over".

    ex:"#$ticket_id"

    on this function i'm passing the ticket_id ... and this function calls one div that to one query to get the data of ticket and shows on div by innerHTML.

    but isn't working.. if I remove the div tag. it works
  • allanallan Posts: 63,552Questions: 1Answers: 10,477 Site admin
    I'm afraid I don't quite understand what you mean by calling a div. A div is an element, not a function - it can't be called, although it can be selected / edited. Are you using fnFilter? Can you show us the code please?

    Allan
  • alissonxalissonx Posts: 25Questions: 0Answers: 0
    ok, I know that isnt a function.

    the function mostraDADOs() shows the div.

    i'm using the default filter.

    [code]
    $(document).ready(function(){
    $('#tabelaProtocolos<?=$numeroTabela;?>').dataTable({
    "bProcessing": true,
    "bSort": false,
    "bLengthChange": false,
    "bStateSave": false,
    "sPaginationType": "full_numbers",
    "aoColumns": [{ "sType": "string" },null,null,null,null]


    });

    });

    [/code]

    the hyperlink with onmouseover.
    [code]
    #i$protocolos_codigo
    [/code]

    [code]
    function mostraDados($protocolos_codigo,$Empresa)
    {


    echo"document.getElementById(\"Div_Flutuante\").innerHTML=$corpo";
    echo"document.getElementById(\"Div_Flutuante\").style.display=\"table-row\"";

    } [/code]
  • alissonxalissonx Posts: 25Questions: 0Answers: 0
    when I tryied to search... the search returns nothing.. if I remove the function onmouseover and the div... the search works.
  • allanallan Posts: 63,552Questions: 1Answers: 10,477 Site admin
    How are you calling the filter? I've just put up an example with your mouseover link here: http://datatables.net/dev/div_search.html - If I search for "protoco" in the filter input box it appears to be filtering okay.

    Allan
  • alissonxalissonx Posts: 25Questions: 0Answers: 0
    right.. but look my div is used to show informations when on mouse over... when on mouse out the information disapear... the text on the div is updated with a function in javascript usin innerHTML, when I try to search something with a div.. the search dont work...
  • allanallan Posts: 63,552Questions: 1Answers: 10,477 Site admin
    So:

    1. You have the table cell with mouseover / mouseout
    2. The search works okay in DataTables
    3. You update the cell with innerHTML
    4. The search doesn't work

    Is that correct? If so I see what the problem is - you need to use the fnUpdate function ( http://datatables.net/api#fnUpdate ) to update the cell, not innerHTML. The reason for this is that DataTables can't know that you've updated the HTML of the cell when you do it with innerHTML, so it doesn't know the new search value. fnUpdate fixes that.

    Allan
  • alissonxalissonx Posts: 25Questions: 0Answers: 0
    right... but the div dont stays of the data table... stays out... onmouseover just show the div.. i'm not using the row on the table.
  • alissonxalissonx Posts: 25Questions: 0Answers: 0
    look, here I have an example of the DIV

    http://www.alissongoncalves.com.br/AllanJardine/protocolos.htm

    pass mouse over the #356 ticket to see the div... the datatable is desactivated in this example.. only to you see the div..
  • allanallan Posts: 63,552Questions: 1Answers: 10,477 Site admin
    The reason this isn't working is that the HTML you are using isn't valid. For example you have:

    [code]
  • alissonxalissonx Posts: 25Questions: 0Answers: 0
    right...

    its working.. only the search is not... sorry my bad english... i'm braziliam..

    I tryed a lot a of times.. to use this div, but really.. the search dont work...
  • allanallan Posts: 63,552Questions: 1Answers: 10,477 Site admin
    Have you corrected the HTML issues that the validator flags up? In the example you linked to there are still the same issues. DataTables requires valid HMTL in order to work, otherwise the number of options that would need to be supported would just be impossible.

    Allan
This discussion has been closed.