-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Work with server-loaded data #2
Comments
Yes, server-loaded data would be a very helpful feature! |
I second that |
can you built a server-loaded data script for me. I try to do that but no chance :( I also would like to Donate this feature. |
Thanks for the offer @mbdesign. I'm not available for hire right now, but if you email me I can get back to you. Does anyone who wants this feature have server loaded data working without ColumnFilterWidgets? It would be helpful to know what goes wrong when ColumnFilterWidgets is added. |
I let you know if ill be back in Office the next days. Thanks in advance Gruß Markus Brandt Via Commodore C64 - Exchange V1.0 Am 05.07.2012 um 16:20 schrieb "Dylan Kuhn" [email protected]:
|
If by server-loaded data you mean just the standard table data coming back from the server (via ajax), yes I have it partially working.
// New way - more forgiving of hidden vs visible column numbering
// or aaData member naming or something
var sValue = this.fnGetData(iRow, iColumn);
// Old way
// var aData = this.fnGetData(iRow);
// var sValue = aData[iColumn];
|
Hi Venzy, I finally went along and implemented my own system for filtering in the meantime. The extra data problem you describe I solved by defining the filters server-side. Each widget takes the same construction arguments; so you can define each widget with either a fixed set of options, or an Ajax call pretty easily. The filters themselves are Javascript widgets that get constructed with meta-data while rendering the page's view. Cheers, |
@venzy thanks for mentioning fnGetColumnData updates, I started issue #15 for that @aphofstede it does sound like the implementation might be significantly different enough to warrant a separate plug-in - maybe you could kick that off? |
How is the progress? |
You'll need to prefetch a distinct set of column data so data from all pages is in the dropdowns. I made a working query to do this (which is rather fast) depending on several php variables :
This query returns with s as ( select site_id , (site_id + ' - ' + ISNULL(descr,'') + ' ' + ISNULL(city,'') + ' (' + country_id + ')') as descr , country_id from site WHERE country_id IN ('BEL') AND UPPER(SUBSTRING(LOWER(site_id),1,3)) IN ('BEL') AND LOWER(site_id) LIKE '[a-z][a-z][a-z][_]%' ) select * from ( select case when row_number() over (partition by site_id order by site_id) = 1 then site_id else null end as site_id, case when row_number() over (partition by descr order by descr) = 1 then descr else null end as descr, case when row_number() over (partition by country_id order by country_id) = 1 then country_id else null end as country_id from s ) t where site_id is not null or descr is not null or country_id is not null when my base table = select site_id , (site_id + ' - ' + ISNULL(descr,'') + ' ' + ISNULL(city,'') + ' (' + country_id + ')') as descr , country_id from site WHERE country_id IN ('BEL') AND UPPER(SUBSTRING(LOWER(site_id),1,3)) IN ('BEL') AND LOWER(site_id) LIKE '[a-z][a-z][a-z][_]%' The lower part of the script will rearrange the array to strip the nulls. This gives me all Dropdown-data, but I don't now how to enter the returned data into ColumnFilterWidgets. Could you explain how to custom-fill the Widgets ? |
I've got it working. |
@TrueOsiris do you or anyone else have this working with PHP and SQL? I can get the information into the filter buttons but when searching the rsult is always nothing. |
We need this too. ColumnFilterWidgets works great with our server-side pagination, and the filters work, querying the server too. The ONLY problem is what is listed above, the drop downs don't populate with all the data needed. I'm looking into the following possibilities: #2. Including the JS arrays for the drop downs inside the JSON response from the Ajax call data tables gets its data from. Not sure where to put it yet, but I will look into it. #2 is my preference, but may not be practical either. I could use the other plugin which is much more advanced, but this one seems to be a bit better written. So I will attempt it. p.s. Oops, didn't mean to link to issues |
Hi Kinda missed this mail in the enormous list of spam I get. Vriendelijke groeten, cordialement, kind regards, Tim Chaubet ----- Oorspronkelijk bericht ----- Van: "Jordan Robinson" [email protected] @TrueOsiris do you or anyone else have this working with PHP and SQL? I can get the information into the filter buttons but when searching the rsult is always nothing. — |
Suggested here: http://datatables.net/forums/discussion/comment/26755#Comment_26755
The text was updated successfully, but these errors were encountered: