Question regarding cell data replacement and global or column searches
Question regarding cell data replacement and global or column searches
![cachiap](https://secure.gravatar.com/avatar/fd6d4d101b3a7b254652da245ebcc9b3/?default=https%3A%2F%2Fvanillicon.com%2Ffd6d4d101b3a7b254652da245ebcc9b3_200.png&rating=g&size=120)
Allan,
I have run into a difficulty when searching and I need to know if there is a solution I have overlooked.
Here is my problem.
My MySQL database table that I am searching contains a "date" column that uses a bogus date "9999-12-13" to indicate that the entry is OBSOLETE. I am trying to find a way to present that date information as the text "OBSOLETE" for the client.
I am using serverside processing.
I have tried both "mRender" and "cellCreated" to change the bogus date to "OBSOLETE" but global and column searches only recongnise the date and not the text. I realise now that this is because they are operating on the serverside where only the date is present.
Is there some work around that I have not found in the manual to help with this? I need to work on the serverside to make these client tables load quickly as some clients have tables with several thousand rows of data.
Am I stuck with this situation?
Thanks
Paul
This question has an accepted answers - jump to answer
Answers
Hi Paul,
Can you show me how you were using the mRender option (
columns.render
in 1.10 notation)? That should work okay -createdCell
will not work for the search data since that modifies the cell, not the DataTables cached data, butcolumns.render
should work correctly).Allan
Allan,
Thanks for pointing me to the relevant areas in your manual.
I have read up on Orthogonal Data and columns.render and I can get the desired display I want ... replacing the date "9999-12-31" with the word "OBSOLETE" but the global and column specific searches still only recognize the date format and not the text.
I have included the script below from my programme. The table is constructed from a join employing data from three databases.... 'location','product_name', and 'pdflocation'. The date I am trying to manipulate belongs to the 'product_name' database
Could you try:
If that doesn't work, could you give me a link to the page or a debug trace?
Thanks,
Allan
Allan,
I tried the change you suggested. But it did not resolve the problem.
Here is my debug code: erajij
In addition here is a link to the active site as you requested:
http://www.paulandkirk.com/Debolt/data/ClientPages/DataTables/DataTables-1.10.7/extensions/Editor-PHP-1.4.2/examples/inline-editing/ClientInventory1_join.php
I have set this up so it opens to the Demonstration Company. There are several OBSOLETE records here as well as other active records. The global search works on the active dates but fails to find OBSOLETE records. Note that there are 13 "null" values at the start of this data set but if you scroll down you will find the rest of the data.
Thanks for looking at this.
Paul
Hi Paul,
That's the bit of information I was missing - thanks for the link and debug code.
The suggestions I've given above are all client-side, but since you are using server-side processing the filtering is of course being done at the server-side. You would need to modify whatever server-side script you are using to perform the filtering you want - possibly some nasty SQL statement :-).
Alternatively, use client-side processing - server-side should only be needed for tens of thousands or more of records.
Allan
Allan,
Sorry for the delay in answering your last comment. You are right as usual. I made a change to the SQL and the search is working fine now :-)
Thanks again for your great advice.
Cheers,
Paul