ColVis gets wrong

ColVis gets wrong

DUCKFACEDUCKFACE Posts: 24Questions: 0Answers: 0
edited October 2012 in Plug-ins
hello there ..
i messed up
i used ColVis and Column Filter add-on but the filtering does not work as it should be.
and now i cant make my columns visibe. am i suppose to clear the browser cache? or ...
on each table im using there are missing columns.
here is an example
http://expert-2002.com/multisys/support/table_view.php
where did i get wrong with this colvis ?


table tool is messed up too. copy to clipboard is "save in csv" ... where i get wrong ?

Replies

  • allanallan Posts: 63,394Questions: 1Answers: 10,450 Site admin
    Did you look at the Javascript console in your browser? There is a Javascript error and a missing file. I'd suggest that be addressed first.
  • DUCKFACEDUCKFACE Posts: 24Questions: 0Answers: 0
    here is what i see in firebug http://expert-2002.com/DUCKFACE/fb.JPG
    copy_csv_xls.wsf is OK, after that aborted, after that OK again. there are no errors in error cosole. when i press copy to clopboard i get csv file ..
    as you can see this is the table tools conection :
    "oTableTools": {
    "sSwfPath": "../eng/swf/copy_csv_xls.swf",
    "aButtons": [
    {
    "sExtends": "copy",
    "sButtonText": "Copy to clipboard"
    },
    {
    "sExtends": "csv",
    "sButtonText": "Save to CSV"
    },
    {
    "sExtends": "xls",
    "sButtonText": "Save for Excel"
    }
    ]
    }

    but the maip part that is bother me is ... that there are 5 columns and im suppose to have 6.
    http://expert-2002.com/DUCKFACE/fb1.JPG
    as you can see in the code :
    "aoColumns": [{"mDataProp":"firm_name","sClass":"left"},{"mDataProp":"date_ot","sClass":"center"},{"mDataProp":"date_do","sClass":"center"},{"mDataProp":"rv","sClass":"right"},{"mDataProp":"kodnkpd","sClass":"right"},{"mDataProp":"dlujnost","sClass":"left"}]
    and the server response is for 6 columns too:
    {"sEcho":1,"iTotalRecords":"1072","iTotalDisplayRecords":"1071","aaData":[{"firm_name":"BTK AD","date_ot":"01.02.2005","date_do":"23.09.2008","rv":"8","kodnkpd":"74222023","dlujnost":"\u0422\u0435\u043b\u0435\u0444\u043e\u043d\u0435\u043d \u0442\u0435\u0445\u043d\u0438\u043a \u043e\u0431\u0441\u043b\u0443\u0436\u0432\u0430\u043d\u0435 \u0438 \u0440\u0435\u043c\u043e\u043d\u0442"}
  • allanallan Posts: 63,394Questions: 1Answers: 10,450 Site admin
    I just checked in Chrome and see multiple errors reported on the console:

    Failed to load resource: Could not connect to the server.
    jquery-columnFilter.jsFailed to load resource: Could not connect to the server.
    javascript.jsFailed to load resource: Could not connect to the server.
    table_view.php:182TypeError: 'undefined' is not a function (near '...} ).columnFilter({ aoColumns:[{"type...')
    jquery.js:2XHR finished loading: "http://expert-2002.com/multisys/eng/eng_make_from_jquery.php".

    Allan
  • DUCKFACEDUCKFACE Posts: 24Questions: 0Answers: 0
    im getiing only his in chrome
    PPB_Graphics2D.PaintImageData: Rectangle is outside bounds.
    im wondering how can you see those errors above. look at the html code of the page .. all of the js files are available. and here is the datatable js function
    function fnFormatDetails ( nTr )
    {
    var aData = oTable.fnGetData( nTr );
    var sOut = '';
    sOut += 'отпечатване:'+aData['listing']+'';
    sOut += 'Link to source:Could provide a link here';
    sOut += 'Link to source:Could provide a link here';
    sOut += 'Link to source:Could provide a link here';
    sOut += 'въведено от:'+aData['id_user_name']+'';
    sOut += '';

    return sOut;
    }

    $(document).ready(function() {
    oTable = $('#table_obuchenie').dataTable( {"bProcessing": true, "bServerSide": true, "sAjaxSource": "../eng/eng_make_from_jquery.php", "sServerMethod": "POST", "oLanguage": { "sUrl": "../lang/dataTables.bg.txt"}, "sDom": '<"H"RCTlfr>t<"F"rip>', "bJQueryUI": true, "sPaginationType": "full_numbers", "bStateSave": true,
    "oTableTools": {
    "sSwfPath": "../eng/swf/copy_csv_xls.swf",
    "aButtons": [
    {
    "sExtends": "copy",
    "sButtonText": "Copy to clipboard"
    },
    {
    "sExtends": "csv",
    "sButtonText": "Save to CSV"
    },
    {
    "sExtends": "xls",
    "sButtonText": "Save for Excel"
    }
    ]
    },
    "aoColumnDefs": [ { "bVisible": false, "aTargets": [ 2 ] }], "bSortCellsTop": true,
    "aoColumns": [{"mDataProp":"date","sClass":"center"},{"mDataProp":"nomer","sClass":"left"},{"mDataProp":"izdaden","sClass":"left"},{"mDataProp":"kategoriq","sClass":"left"},{"mDataProp":"kvalifi","sClass":"left"},{"mDataProp":"grupa","sClass":"left"},{"mDataProp":"validen","sClass":"center"}],
    "fnServerParams": function ( aoData ) {
    aoData.push( { "name": "tables", "value": '[{"name":"obuchenie","type":"f","prx":"p"}]' } );
    aoData.push( { "name": "columns", "value": '[{"name":"date","type":"date","prx":"p"},{"name":"nomer","type":"text","prx":"p"},{"name":"izdaden","type":"text","prx":"p"},{"name":"kategoriq","type":"text","prx":"p"},{"name":"kvalifi","type":"text","prx":"p"},{"name":"grupa","type":"text","prx":"p"},{"name":"validen","type":"date","altname":"validen","prx":"p"}]' } );
    aoData.push( { "name": "editable", "value": '0' } );
    aoData.push( { "name": "where", "value": '' } );
    aoData.push( { "name": "engina", "value": 'jquery_table' } );
    }

    } ).columnFilter({ aoColumns:[{"type":"date"},{"type":"text"},{"type":"text"},{"type":"text"},{"type":"text"},{"type":"text"},{"type":"date"}]});
    $.fn.dataTableExt.oApi.fnVisibleToColumnIndex = function ( oSettings, iMatch ) {
    return oSettings.oApi._fnVisibleToColumnIndex( oSettings, iMatch );
    };
    } );
  • DUCKFACEDUCKFACE Posts: 24Questions: 0Answers: 0
    okey .. see what iv got from IE script error
    row: 134
    sign: 4
    error: Unknown runtime error
    code: 0
    URL: jquery-ZeroClipboard.js
  • DUCKFACEDUCKFACE Posts: 24Questions: 0Answers: 0
    boys ... i still have problem with this
  • allanallan Posts: 63,394Questions: 1Answers: 10,450 Site admin
    Please link us to an example showing the problem. The page at the top appears to work okay for me.

    Allan
  • DUCKFACEDUCKFACE Posts: 24Questions: 0Answers: 0
    https://expert-2002.com/multisys/support/table_view.php
    no .. its not working OK.
    1. try to filter the columns. you will get the result form the NEXT comum. for example try to search in NKPD code 03 (you can see that there is xxxxxx03 in the column). result will be - not foind. then .. type 03 in working time - it will search not in working time but in NKPD code. (there is a hidden cell wich i cnan't make visible). this is on every table on the page.
    2. when you press copy to clipboard it export the file to xls.
    3. save to csv - not working
    4. save to excel (button) - not working

    5. how to make it work not to send request to server on every heypress. its hurts a lot on my server ... especialy when you make lag database :S
  • DUCKFACEDUCKFACE Posts: 24Questions: 0Answers: 0
    Allan .. did you saw the problem ?
  • allanallan Posts: 63,394Questions: 1Answers: 10,450 Site admin
    1. If it is off by one then your server-side processing script isn't taking into account the mData property that you set. There will be an error in the script logic somewhere.

    2-4. It looks like you are initialising the table when it is hidden - that will break TableTools since it can't match the height/width of the buttons for the Flash movies. Either initialise it visible, or use http://datatables.net/extras/tabletools/api#fnResizeButtons when you make it visible.

    5. Put a key denounce into your filter code. There is a simple example of that for the global filter here: http://datatables.net/plug-ins/api#fnSetFilteringDelay . You can apply that same basic setTimeout logic to your own column filters.
  • DUCKFACEDUCKFACE Posts: 24Questions: 0Answers: 0
    Allan .. its imposible to put your function to be echo-ed by php .. it gives me error on
    var $$this = $this;
    error is: Object of class could not be converted to string.
  • allanallan Posts: 63,394Questions: 1Answers: 10,450 Site admin
    I don't understand why you would want to echo one of my functions? Also, which function?
  • DUCKFACEDUCKFACE Posts: 24Questions: 0Answers: 0
    for point 1.
    server side is working just fine .. i just can't understand why one of the columns is not visible. i didn't make it invisible. look at the sorce gode and you will see that there is nothing 'invisible'.
    for points 2 to 4.
    im calling it form PHP. it's just regual echo rfom php. its not hidden.
  • DUCKFACEDUCKFACE Posts: 24Questions: 0Answers: 0
    im 'echo'ing the functions bevcause of the dynamic rows number. im creatinf universal include file wich will return the table when i describe the parrameters of the row. for example i put the name=>'address', label=>'street', type=>'text' and it retuns me row with head called for mData 'address', the visible lable of the row is 'street' and the results are align right. also adding extra aoData.push on it. All this on PHP .. then i make echo of the result.
This discussion has been closed.