maxazan / jquery-treegrid

TreeGrid plugin for jQuery
http://maxazan.github.io/jquery-treegrid
MIT License
553 stars 222 forks source link

make $('.noSelect').disableTextSelect() for row #9

Open maxazan opened 10 years ago

tablatronix commented 10 years ago

Should add

.treegrid-expander{
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: moz-none;
    -ms-user-select: none;
    user-select: none;
}

I tried event.preventDefault(); and event.stopPropagation(); on the click ( and even a dblclick) nothing seemed to work on blocking the clicks from bubbling to the td and selecting the text. Maybe i missed something specific about table events.

tablatronix commented 10 years ago

Actually nm,

            $(tpl).prependTo(cell).click(function(event) {
                $($(this).closest('tr')).treegrid('toggle');
            }).bind('selectstart dragstart', function(evt)
              { evt.preventDefault(); return false; });

works for preventing the expander clicks to highlight td text. Might be a different issue but seems related. Users can deal with row selections themselves, should not be handled by plugin imo.