institut-de-genomique / Ultimate-DataTable

This AngularJS directive generate a HTML table with build-in fonctionnality like save, edit, remove, pagination etc...
http://institut-de-genomique.github.io/Ultimate-DataTable/
45 stars 26 forks source link

Custom action when row is selected #17

Closed Jenselme closed 8 years ago

Jenselme commented 8 years ago

Hi,

I would like to call a custom function when a user clicks or passes the mouse over a row. Is something like this possible? I saw in the documentation that I can add a show button to do something like that, but I want to avoid the counter intuitive extra click.

galbini commented 8 years ago

Hi,

This feature not exist but it's possible to implement it. The difficulty is to decide what's happen when user select all the lines in one time with the checkbox button, do you have any idea ?

Jenselme commented 8 years ago

The difficulty is to decide what's happen when user select all the lines in one time with the checkbox button

Good question, I haven't thought of that. The best thing to do I think is either to pass an array of all the selected lines or do nothing and specify in the documentation that this action will only happen when you explicitly click on one row. What do you think?

galbini commented 8 years ago

Hi,

Ok I try to implement this feature ASAP.

Best Regards, Guillaume

galbini commented 8 years ago

Hi Julien,

I add a callback function on select configuration.

"select":{
    "active":true,
    "callback":function(line,data){
        console.log("callback select : "+data.name);
    }
}

Can you try ? Regards, Guillaume

Jenselme commented 8 years ago

Hi,

I just tested it and it works great. Can we have something similar for mouseover?

galbini commented 8 years ago

Hi,

There are actually nothing for manage mouseover event but if you want you can try to implement this. It's not trivial because you need to manage in write mode and in read mode.

Regards, Guillaume

Jenselme commented 8 years ago

Thanks for your answer. I'll see what I can do.

Closing this issue. I may open a PR if I do the mouseover.