Server Side Search & SearchPanes with Customer Order -> JavaScript Fault
Server Side Search & SearchPanes with Customer Order -> JavaScript Fault

Hi,
I have issues with server side search together with custom ordered searchpanes. Took me a bit time search around for a free provider with SQL/PHP support and preparing the test files
Click here for good testcase without customordering -> No issues at all.
Click here for bad testcase with custom ordering -> JS fault (jquery, JS datatables, JS searchpanes) if you push an entry from search panes.
testdt_bad.html:103 Uncaught TypeError: Cannot read property 's' of undefined
at n._serverTotals (testdt_bad.html:103)
at HTMLTableElement.<anonymous> (testdt_bad.html:103)
at HTMLTableElement.dispatch (testdt_bad.html:36)
at HTMLTableElement.v.handle (testdt_bad.html:36)
at Object.trigger (testdt_bad.html:36)
at HTMLTableElement.<anonymous> (testdt_bad.html:36)
at Function.each (testdt_bad.html:36)
at S.fn.init.each (testdt_bad.html:36)
at S.fn.init.trigger (testdt_bad.html:36)
at Ot (testdt_bad.html:43)
It does not make any difference if you order by:
order: ['Column2', 'Column1']
or by
columns: [2,1]
Everything else is completely same. If you change order by this options -> error.
For the record, the SQL connector or the Libs does not have any special hacks.
// Alias Editor classes so they are easy to use
use
DataTables\Editor,
DataTables\Editor\Field,
DataTables\Editor\Format,
DataTables\Editor\Mjoin,
DataTables\Editor\Options,
DataTables\Editor\Upload,
DataTables\Editor\Validate,
DataTables\Editor\ValidateOptions,
DataTables\Editor\SearchPaneOptions;
Editor::inst( $db, 'testdt', 'id' )
->fields(
Field::inst( 'id' ),
Field::inst( 'CaseID' ),
Field::inst( 'CaseNumberSFDC', 'Case No' ),
Field::inst( 'CreateDate', 'Time Opening' ),
Field::inst( 'CaseQualification', 'Qualification' )
->searchPaneOptions( SearchPaneOptions::inst()
),
Field::inst( 'Status' )
->searchPaneOptions( SearchPaneOptions::inst()
),
Field::inst( 'Priority' ),
Field::inst( 'CaseOrigin', 'Origin' )
->searchPaneOptions( SearchPaneOptions::inst()
),
Field::inst( 'FailureType', 'Failure Type' )
->searchPaneOptions( SearchPaneOptions::inst()
),
Field::inst( 'CaseSubject', 'Subject' ),
Field::inst( 'CaseSubject_trans' ),
Field::inst( 'CaseDescription', 'Description' ),
Field::inst( 'CaseDescription_trans'),
Field::inst( 'Region', 'Region' )
->searchPaneOptions( SearchPaneOptions::inst()
)
)
->debug(true)
//->write( false )
->process($_POST)
->json();
Made everything default. The Datatables/Searchpanes are pretty current (nightly from last week).
This question has an accepted answers - jump to answer
Answers
Hi @tefdat ,
I'm not seeing any errors in the console, or behaviour, on either of your pages. What steps do I need to take on the page to get the error?
Thanks,
Sandy
Hi @sandy ,
just click one of the searchpane list elements in the testdt_bad.html example.
Regards..
Hi @tefdat ,
Thanks I can see it now. There is something strange going on there. I've raised an issue internally (DD-1707 for my reference) and will report back here when there is an update. Hopefully at the end of the week.
Thanks,
Sandy
Hi @tefdat ,
That should be the issue fixed now. If you get a new version from the nightly builds then it should be working fine for you.
Thanks,
Sandy
Working flawlessly. Thank you very much sandy!