question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cookie extension should not override data-search-text property value

See original GitHub issue

When I set initial value for the input search, the result input value is always set to the empty string. (eventhough I don’t want the searchInput text cookie to be used) Table properties:

data-search-text="mySearchValue"
data-cookies-enabled="['bs.table.columns']"

The core of the problem resides in the cookie extension. It always passes empty string no matter other property (cookie is not defined, data-search-text is set)

  // this.options.searchText ... mySearchValue
  // searchTextCookie  is null
   this.options.searchText = searchTextCookie ? searchTextCookie : '';

I suppose that correct behavior should be something like this (pseudocode):

  if (cookieEnabled('bs.table.searchText') && this.options.searchText == '') {
        this.options.searchText = searchTextCookie ? searchTextCookie : '';
  }

Used version: 1.16.0

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9

github_iconTop GitHub Comments

1reaction
djhvscfcommented, Jul 31, 2020

I dont think so, because if somebody use a default value he want to filter for a default dataset. If somebody change that filter he has a reason for that. Maybe we could add an option to switch between cookie > default and default > cookie. @wenzhixin @djhvscf what do you think ?

I think we can add an option like data-cookie-override-search='true' or something in order to define the precedence

0reactions
djhvscfcommented, Nov 23, 2021
Read more comments on GitHub >

github_iconTop Results From Across the Web

Swift - How can I override an extension method in a ...
Tried this with swift 2.0, seems to compile fine if you have the override but still refers to the extensions values and not...
Read more >
Override protocol extension from framework
It is not possible to override functionality (like properties or methods) in extensions. This is documented in Apple's Swift book in section "Extensions"...
Read more >
Allow `override` of `open` methods in & from extensions ...
I use extension a lot to clarify my code, separating the main declaration of a class/struct and its properties from the methods I...
Read more >
Cookie Override – Get this Extension for Firefox (en-US)
The extension allows to add rules overriding specific cookie values whenever a website producing the cookie is visited.
Read more >
Table Options - Bootstrap Table
The table options are defined in jQuery.fn.bootstrapTable.defaults . -. Attribute: data-toggle. Type: String. Detail: Activate bootstrap table without ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found