Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Select plugin refresh not triggered for datatable.row.add #306

Closed
gauravjhs opened this issue Apr 18, 2016 · 12 comments
Closed

Select plugin refresh not triggered for datatable.row.add #306

gauravjhs opened this issue Apr 18, 2016 · 12 comments

Comments

@gauravjhs
Copy link
Contributor

Hi,

When I am adding rows to datatables, for filter_type multi_select, internal select box is updating the new values, but select plugin is not getting refreshed.

@vedmack
Copy link
Owner

vedmack commented Apr 19, 2016

please provide a link to test case jsbin / jsfiddle / etc'

@gauravjhs
Copy link
Contributor Author

gauravjhs commented Apr 19, 2016

Hi Vedmack,

I am unable to create a jsbin/jsfiddle being a first time user of those services.
Am not able to include your latest js file in their resource library. Can you help me out with this.

Or if you can create a sample fiddle for me to work on. Apologies for the inconvenience.

Issue is when I call datatable.row.add to add more data into data table, it is not reflected in the filter.
selectElementCustomInitFunc is being called instead of selectElementCustomRefreshFunc

@gauravjhs
Copy link
Contributor Author

Hi Vedmack

Please look at http://jsbin.com/bayuru/edit?html,js,console,output

Created 2 select box filters. Basic select box is updated with no value. MultiSelect plugin box is not getting refreshed.

@vedmack
Copy link
Owner

vedmack commented May 7, 2016

Hi

There was an issue in your code - invalid use of the exFilterColumn <-- read docs,

See this jsbin sample , click on First Col / Second Col to see how the filters / table reacts...

As to the datatable.row.add, I don't see its use in the jsbin. You should extend that jsbin to reflect your issue...

@gauravjhs
Copy link
Contributor Author

Hi,
I was using someone else code, that's why the exFilterColumn. I have removed it as I am not using that.

I have not used datatable.row.add in this example as of now.
Issue can be seen what I clear datatables with
dataTableObjRedraw.clear();
dataTableObjRedraw.draw();

Multiselect plugin still reflects the old values but normal select box clears all previous values.
i.e. Multiselect is not able to refresh underlying values.

Hope I am clear this time.

@vedmack
Copy link
Owner

vedmack commented May 9, 2016

If you made a new test sample please provide its code
On May 9, 2016 9:43 AM, "Gaurav Agarwal" notifications@github.com wrote:

Hi,
I was using someone else code, that's why the exFilterColumn. I have
removed it as I am not using that.

I have not used datatable.row.add in this example as of now.
Issue can be seen what I clear datatables with
dataTableObjRedraw.clear();
dataTableObjRedraw.draw();
Multiselect plugin still reflects the old values but normal select box
clears all previous values.
i.e. Multiselect is not able to refresh underlying values.

Hope I am clear this time.


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#306 (comment)

@gauravjhs
Copy link
Contributor Author

I have removed exFilterColumn. Please check jsbin http://jsbin.com/bayuru/edit?html,js,console,output

@vedmack
Copy link
Owner

vedmack commented May 11, 2016

Sorry, but I really can't understand what are you trying to show in your jsbin sample?

You must provide a scenario with expected flow / and to explain whats the actual flow, the moment you will provide a jsbin sample with the expected / actual flow I will be able to try and help you, untill then - I can't

@gauravjhs
Copy link
Contributor Author

I have made a button to clear data in Datatables.

Case 1: Load Datatable with initial data and load filters.
Expected : Table generated with proper filter values.

Case 2: Clear data present is datatables
Expected : Data rows is removed and all values in filters are removed.
Actual : Column 1 filter still retains old values(Should have cleared these values). Column 2 filter clears old Values (as expected)

yadcf

Please see the jsbin http://jsbin.com/bayuru/edit?html,js,console,output with "Clear Datatables" button.

@gauravjhs
Copy link
Contributor Author

Hi Vedmack,
Were you able to figure out the issue?

@vedmack
Copy link
Owner

vedmack commented Jun 8, 2016

Hi,
It looks more a multi select plugin issue than yadcf, it seems that when you init the multi select it does not clear its values, so the only possible solution I came with is to init it / destroy then init again

like this

yadcf.initSelectPluginCustomTriggers(
    function(selectBoxObj) {
      selectBoxObj.multiselect({});
      selectBoxObj.multiselect("destroy");
      selectBoxObj.multiselect({});
    },
    function(selectBoxObj) {
      selectBoxObj.multiselect('refresh');
    });

See working sample

@vedmack vedmack closed this as completed Jun 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants