ColumnFilterWidgets Plug-in - Page 2

ColumnFilterWidgets Plug-in

2»

Replies

  • AJNormanAJNorman Posts: 1Questions: 0Answers: 0
    Any idea how to space out the hyperlinks when making multiple selections?

    The hyperlinks are staying on one line and there is no space between them.

    Also, the filter boxes are going down the page and not across the page like the example.
  • OsirisOsiris Posts: 36Questions: 0Answers: 0
    @AJNorman : it seems like you didn't include the css that's provided in ColumnFilterWidgets.
  • OsirisOsiris Posts: 36Questions: 0Answers: 0
    I've got server-side running :
    http://datatables.net/forums/discussion/11991#Item_1
  • Alexs6Alexs6 Posts: 2Questions: 0Answers: 0
    Thank you veeery much! Great job! Both DataTables and ColumnFilterWidgets.

    Does anyone knows how to get ColumnFilterWidgets working when using fnRender function to display not just value, but some kind of html like this:

    [code] "aoColumns": [
    {
    "sName": "User",
    "mDataProp": "User",
    "fnRender": function (oObj) { return '' + oObj.aData[oObj.oSettings.aoColumns[oObj.iDataColumn].mDataProp] + '' ; }

    },
    [/code]

    When using filter all records just dissapear. Common sorting works perfectly, but filtering does not. Any suggestions?
  • Alexs6Alexs6 Posts: 2Questions: 0Answers: 0
    edited November 2012
    Ammm, i found the solution myself. Maybe it will be usefull for somebody(javascript newbies like me+_+), who is using MVC3.
    So, the problem is that fnGetColumnData function returns not the needed value, but the full html(i.e Some value ) To be able to filter correctly, function must return just "Some value". So i`v changed the code like this:
    [code]
    for (var i = 0, c = aiRows.length; i < c; i++) {
    iRow = aiRows[i];
    sValue = $('' + this.fnGetData(iRow, iColumn) + '').text();
    // ignore empty values?
    if (bIgnoreEmpty == true && sValue.length == 0) continue;

    // ignore unique values?
    else if (bUnique == true && jQuery.inArray(sValue, asResultData) > -1) continue;

    // else push the value onto the result data array
    else asResultData.push(sValue);
    }
    [/code]

    $.text allows us to ignore html and get only text value. In the result filtering goes well. Enjoy.
This discussion has been closed.