Problem of mixing cell data of different rows after resetting filters

Hello,

Faced the problem of mixing cell data of different rows after resetting filters.

Take a look at the screenshots.

This screen before I applied the filter (remember the contents of the cells in the rows):

Here I applied a filter and highlighted the lines:

On this screen, I reset the filter. Have you noticed how the cells that should be empty were filled with information from other people’s lines? Also note the highlighted lines, they have changed (these are not the lines I highlighted):

This greatly interferes with the normal operation of the application. Has anyone been able to solve this problem and how?

Thanks in advance!

Somebody can tell the reason of such behavior of the table? It would help to find a solution in thematic communities.

I think this problem was discussed - and solved - here.

2 Likes

Yes, Tom. This is exactly the problem you encountered earlier. Thank you so much for sharing!

The solution helped for normal cells. And that’s good! But what to do with checkboxes? What to do with them, so that after the filter is reset, the selected checkboxes remain on the same records, and not “move down” to others?

I’m glad that helped. The issue has cropped up a few times and will probably continue to do so.

Isn’t the problem/solution the same with checkboxes? I’ve just had a quick look at one of my tables included columns with checkboxes. In this case I set a default of zero for the checkbox columns, when records are inserted - or you could set a default when you define the column properties.

I do not fully understand which checkbox parameter I should apply the setting to .default ("). Here is the structure of my checkbox cell:

The record id is stored in the checkbox. There are no records without id in principle, but even if applied to this parameter .default (") then the problem will not be solved.

I don’t think I’ve used checkboxes like this - I always use them with values of 1 or 0. Anyway, if all records should have a value in this field, is validation perhaps the issue?

If you want to assign a default value when a record is inserted using a form, you could use something like this: {{$_POST.myCheckbox.default(0)}} .

The fact is that the id parameter is not inserted through the form. This is the auto-increment key of the record, created automatically when the record is created. Thus, the table simply cannot have a record with an empty id value or equal to 0, id always > 0.

That’s good - so the issue of not having a value or needing a default value set doesn’t arise. Also, it doesn’t explain why the wrong values are appearing after filtering (if this is still an issue).

The way you’re using checkboxes sounds odd. Why do you need the IDs to appear- and why, if they’re needed, are they formatted as checkboxes? Checkboxes are typically used for boolean values which you toggle on and off.

Apparently I inaccurately explained. With checkboxes there was no problem with incorrect values (values that are contained in the checkbox), the problem was and is with the" sliding down " of the selection of checkboxes, after resetting the filter. In other words, after the filter is reset, the check boxes that the user selected will not be selected in the table.

The purpose of using checkboxes to store IDs is mass manipulation of records. For example, binding to document records, making changes, and other manipulations with more than one record at a time.

I see why you’re using checkboxes like this, but I’m afraid I don’t understand the problem. Is it still related to the main issue:

? I thought that was resolved. I don’t know what you mean by the ‘sliding down’ of checkboxes.

Apparently this is a different problem, but based on the same reason as the problem of filling empty cells with data from other rows.

I will show the problem in the screenshots. I applied a filter and selected three entries:

Then, without removing the selection, I reset the filter. There are still three records selected in the table, but these are not the records I select (this is incredibly much interferes with the work):

How are you resetting the filter. What is the code for the reset button.
Maybe you could give a link so we can test and see how your app works, how filters are applied, or maybe a short video would be easier to understand

Filter reset - deletes data from inputs that are used for data entry. No code is needed for this. Let’s say a search string in which the entered data is deleted by basic means.

I would unfortunately need to see how your data is being filtered and how it is being reset to try give more assistance with this. For me there are just too many reasons this could not be working to try and help you narrow it down, hopefully others will be able to assist more.
Is your only filter a text string?
Is your text filter updating the data as each letter is input, or do you need to input your string and press a search button?
Is your filter a reset button that resets the string input, or are you just deleting the text you typed in and pressing search again?

If I have more information maybe I can assist as have done something pretty similar and it’s working well.

So. For a visual demonstration, I made a simple example. A small table with fruits and vegetables. The search bar filters values by category field. To see the problem do the following:

  1. In the search bar type fruits;

  2. Highlight Apple, banana and orange (selected checkbox);

  3. Reset the filter (remove the previously entered values from the search string).

You will make sure that the records that you selected are not selected.

http://howitisdone.info/example.html

1 Like

Thanks @Mr.Rubi, when i get to the office in about 7 hours time i will check how i did my other one, and if nobody gives you an answer sooner, i will assist, it’s midnight here now, so I can’t test right now, but it really helped having the example, thank you.

1 Like

I’m not sure if this is the answer, but try adding a unique key here:

image

4 Likes

Yes, Tom, You were quite right! This helped solve the problem. Many thanks for your help!

2 Likes