SearchBuilder : Uncaught TypeError: Cannot read properties of undefined (reading 'sDefaultContent')

SearchBuilder : Uncaught TypeError: Cannot read properties of undefined (reading 'sDefaultContent')

Keith BKeith B Posts: 6Questions: 2Answers: 1

Hi,

This is an initial request for guidance on what to investigate to pinpoint error when using SearchBuilder Indent/Outdent feature.

Debugger code (debug.datatables.net) : efowiy

Uncaught TypeError: Cannot read properties of undefined (reading 'sDefaultContent')
at Object.S [as _fnGetCellData] (datatables.min.js:43:17921)
at w.initSelect [as init] (datatables.min.js:143:20476)
at w._populateValue (datatables.min.js:143:18633)
at w.populate (datatables.min.js:143:9533)
at HTMLButtonElement.<anonymous> (datatables.min.js:143:53776)
at HTMLButtonElement.dispatch (jquery-3.6.4.min.js:2:43184)
at y.handle (jquery-3.6.4.min.js:2:41168)
S @ datatables.min.js:43
w.initSelect @ datatables.min.js:143
w._populateValue @ datatables.min.js:143
w.populate @ datatables.min.js:143
(anonymous) @ datatables.min.js:143
dispatch @ jquery-3.6.4.min.js:2
y.handle @ jquery-3.6.4.min.js:2

Using SearchBuilder works fine and processes the table correctly. However, at times when using the INDENT and OUTDENT functions, the above error is received.
I am trying to determine what to investigate further to identify the component that is causing the error.
In the debug code this error was produced on *R3_tbl

In the following code snippet, the issue appears to be driven by value n being passed in with a value of "" rather than a numeric value.
function S(t, e, n, a) {
"search" === a ? a = "filter" : "order" === a && (a = "sort");
var r = t.iDraw
, o = t.aoColumns[n]
, i = t.aoData[e]._aData
, l = o.sDefaultContent
, s = o.fnGetData(i, a, {
settings: t,
row: e,
col: n
});

Cheers
Keith

This question has accepted answers - jump to:

Answers

  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin
    Answer ✓

    Hi Keith,

    Can you link to a test case showing the issue so I can track it down please? SB should be able to cope with a number value without any issue - although it does sound like there is a code path where it isn't handling it correctly.

    Allan

  • Keith BKeith B Posts: 6Questions: 2Answers: 1

    Hi,

    PM sent with test case details.

  • Keith BKeith B Posts: 6Questions: 2Answers: 1
    Answer ✓

    Closed with a commit made to SearchBuilder to rectify the issue.

Sign In or Register to comment.