Sortable table retaining old value where a NULL is being populated

Hi,

I have a problem where if I have a NULL value on the table row and I perform a Sort, the row where this NULL value has been moved to contains the old value.

Please see below.

Why is this happening?

I have checked on different browsers, so I don’t think it’s related to a browser issue.

Thanks,
Ray

1 Like

Hey Raymond,

I reported this a week or so back, so perhaps there will be an update in the near future. In the meantime you might check out this thread that was forwarded to me:

–Ken

@mebeingken Thanks for the info.

Didn’t want defaults, but it would seem we don’t have a choice ATM.

Thanks
Ray.

OK, so default value fixed the old value from staying in the row, however, I now have a problem where the sort will not work. See below on the ‘Transaction limit’ sort.

Thanks,
Ray.

Can you please provide a link to your page?

I don’t think I have a situation related to the NULL default issue
however, I have a Table Sort issue that does closely resemble the Topic

I now have a problem where the sort will not work. See below on the ‘Transaction limit’ sort."

So, I’ll “butt in” with hopes that it may help more than hinder resolution!

I tried following a referred-to Demo of how to create a one page view of selected data table columns which had a

  1. Live “suggest” search field at the top
  2. Sortable 7 columns similar to the gifs already displayed in this forum topic

I couldn’t get both Suggest Search & Sortable column headers to work in the same form from the Demo.

Only after I altered code directly that Wappler created did I get both actions to happen –
character-by-character dynamic search
and
dynamic column header Sort

But
As this topic illustrates I can not get “dynamic sort” to work Twice consecutively in the same column
One click for ASC then One click for DESC sort
Once I had sorted the default display in a column for either Sort
then
I had to Click in another Column Header, say First Name or Last Name
and let that sort
before I returned to my desired 1st Sort and clicked again to get the remaining sort direction to work.

The javascript SORT in my Combined Search & Sort page needed to be refreshed
by going to another column and clicking once for a column sort that I didn’t need.

Only then could I return to the column that was sorted ASC or DESC
and get the Sort to work one more time.

Database latest mysql with only 362 records, local server php 7.2

Maybe a Browser Cache issue?

@Teodor

Here is a link to a sample page I just did.

https://portal.krinnovations.ie/testtable.aspx

Thanks,
Ray.

Sorry, the link says access denied.

Is the message from Cloud Flare?

If so, please let me know what region to add so you can view the page.

Thanks
Ray.


That’s what i see there. Do you need my IP?

Now the page loads, but none of the js includes load. They get the same 403 error.

You should have access now.

Thanks.

I see something strange in the code:

<th class="sorting" dmx-on:click="allstudentssort.set('sort','mmDailyLimit.default(0.00)');allstudentssort.set('dir',allstudentssort.data.dir == 'desc' ? 'asc' : 'desc')" dmx-class:sorting_asc="allstudentssort.data.sort=='mmDailyLimit.default(0.00)' &amp;&amp; allstudentssort.data.dir == 'asc'" dmx-class:sorting_desc="allstudentssort.data.sort=='mmDailyLimit.default(0.00)' &amp;&amp; allstudentssort.data.dir == 'desc'">Transaction limit</th>

The .default(0.00) part should not be there in the table headers. Please remove it manually and test.
So this: mmDailyLimit.default(0.00) should be just mmDailyLimit

1 Like

Hi Teodor,

OK, that was the problem. I used the bootstrap table generator to select the column and applied the default value.

It would seem either I miss understood where I apply the default value or the bootstrap table generator is placing the default not just on the row but also the header.

Thanks,
Ray.

You just need to apply it (manually add .default(0) on the page (in the code), after you generated the table.
I will check with the team how could this be improved in cases like yours.

1 Like

Perfect thanks!

Regards
Ray.

1 Like