@jscripter
Are you referring to my latest http://jsbin.com/isuga/edit ? Because
as far as text selection is concerned it's working fine for me on
Chrome, Firefox 3, and Internet Explorer 8.
Just out of curiosity, are you clicking and dragging on the first
column? Because the first column is outside of the range of the
dragcheck. It's only the cells with checkboxes that don't have text
selection. Same thing with the ul list, only the list items that have
a checkbox have text selection disabled.

Chrome 2.0 is a pre-beta release, so you can't really do testing on
that. I've got the latest stable release which is 1.0.154.55.

I also use Firefox 3.0.8, and it works fine. I suppose that the cursor
could be set also.

You are right that in Internet Explorer (I use version 8.0.6) the
highlight was not undoing on uncheck. It should work now, I also
included the cursor style which will also be unset with dragCheck
("clear"):

http://jsbin.com/ujugi/edit


On 14 Apr, 17:42, jscripter <pc88m...@gmail.com> wrote:
> Hi,
>
> Here are my testing results:
>
> IE7: table cells highlight to yellow when checkboxes are checked, but
> don't go back to black when unchecked;
>   same issue with ul list items (highlighting stuck on pink)
>
> Opera 9.64: same highlight problem that IE7 has
>
> Chrome 2.0.169.1: dragging in cells just selects text; checking/
> unchecking checkboxes doesn't change background in either the table or
> ul list. (I think some javascript is not getting run)
>
> Firefox 3.0.8: basically works as expected; only nit is that the
> cursor changes to a text insertion bar when over the labels. Perhaps
> this can be fixed with style="cursor: default" ???
>
> (Note: IE7, Chrome and Firefox have the cursor changing to an
> insertion bar when over the checkbox label; only in Opera does the
> cursor stay as an arrow pointer.)
>
> Thanks again for your work on this.
>
> ER
>
> On Apr 14, 3:31 am, Lwangaman <donjohn.f...@gmail.com> wrote:
>
> > Latest:http://jsbin.com/isuga/edit
> > Simplified the code for the highlighting process and corrected the
> > case-possibility that first parameter is left empty (in that case, all
> > child checkboxes are involved).
>
> > Empty parameter usage:
> > $('table').dragCheck()
> > for no parameters;
> > $('table').dragCheck('', 'pink')
> > for empty first parameter.
> > Second parameter can be left out completely.
>
> > On 14 Apr, 09:45, Lwangaman <donjohn.f...@gmail.com> wrote:
>
> > > Ok latest version I've included the possibility of adding a background
> > > color:http://jsbin.com/icena/edit
>
> > > The background color is specified as a second parameter in the
> > > function:
> > > $('table').dragCheck('td:not(.nono) :checkbox', 'pink')
>
> > > To clear the dragCheck:
> > > $('table').dragCheck('clear')
>
> > > On 13 Apr, 23:29, jscripter <pc88m...@gmail.com> wrote:
>
> > > > Here's what I'm shooting for:
>
> > > >http://jsbin.com/izoce/edit
>
> > > > It's basically the same code as found on cross-browser.com, but I've
> > > > added the cell highlighting.
>
> > > > Works under Firefox, Opera and Chrome. It should also work under IE,
> > > > but it doesn't seem to work when on the jsbin.com site. However, if
> > > > you just download it and run it from a local file it should work for
> > > > you.
>
> > > > The text selection bug is basically fixed. It is still possible to
> > > > select text if the mousedown event occurs in the right place between
> > > > cells. I don't think text selection is possible if the border width is
> > > > set to 0 (but then you also don't get a border.)
>
> > > > On Apr 13, 2:30 pm, Lwangaman <donjohn.f...@gmail.com> wrote:
>
> > > > > I think I've done it.
>
> > > > >http://jsbin.com/adixe/edit
>
> > > > > I have also left out the mouseleave event, and applied the mouseup to
> > > > > the whole document instead of to the table, that way even if I leave
> > > > > the table but still have the mouse button down, I don't lose the value
> > > > > in the variable. Only if I let go of the mouse button (on or off the
> > > > > table) do I reset the variable.
>
> > > > > @Ricardo and @jscripter: does this work good?
>
> > > > > On 13 Apr, 14:41, Lwangaman <donjohn.f...@gmail.com> wrote:
>
> > > > > > I tried working on it again and made a little progress... Now I got
> > > > > > parent and child selected correctly, but I don't have mouseover
> > > > > > working for some reason...
>
> > > > > >http://jsbin.com/avigi/edit
>
> > > > > > On 13 Apr, 02:43, Lwangaman <donjohn.f...@gmail.com> wrote:
>
> > > > > > > One more detail: mouseout should not take effect until mouseup.
> > > > > > > In fact, right now, if I click and begin to drag, then still 
> > > > > > > holding
> > > > > > > the mouse button I leave the area, and still holding it come back 
> > > > > > > over
> > > > > > > the cells, they no longer get checked / unchecked because 
> > > > > > > mouseout has
> > > > > > > already kicked in. Instead it shouldn't kick in until I actually 
> > > > > > > let
> > > > > > > go of the mouse button, and I could let go of it anywhere on the 
> > > > > > > page
> > > > > > > I suppose, so I guess "mouseup" would have to be applied to the 
> > > > > > > whole
> > > > > > > document.
>
> > > > > > > On 13 Apr, 02:33, Lwangaman <donjohn.f...@gmail.com> wrote:
>
> > > > > > > > I tried something along those lines...
>
> > > > > > > >http://jsbin.com/ehedu/edit
>
> > > > > > > > But I just don't have the hang of using "this" correctly and 
> > > > > > > > knowing
> > > > > > > > when to refer to dom elements as dom elements or as jquery 
> > > > > > > > objects...
>
> > > > > > > > The idea is to tie all events to the container of the 
> > > > > > > > checkboxes (i.e.
> > > > > > > > table cells), and not to the external container (table or ul 
> > > > > > > > list or
> > > > > > > > whatever), and yet be able to read and write the value of the
> > > > > > > > checkboxes...
>
> > > > > > > > On 13 Apr, 01:13, Lwangaman <donjohn.f...@gmail.com> wrote:
>
> > > > > > > > > Taking up jscripter's suggestion, I just noticed myself that 
> > > > > > > > > applying
> > > > > > > > > the mousedown and mouseover to the whole table keeps you from 
> > > > > > > > > being
> > > > > > > > > able to click on any links that may be contained in the 
> > > > > > > > > table. For
> > > > > > > > > example my table has links in the header cells that when 
> > > > > > > > > clicked
> > > > > > > > > reorder the table according to that column. Now I can no 
> > > > > > > > > longer click
> > > > > > > > > them...
> > > > > > > > > And, as jscripter says, in the X-Library the mousedown and 
> > > > > > > > > mouseover
> > > > > > > > > was applied to the cells containing the checkboxes and not to 
> > > > > > > > > the
> > > > > > > > > checkboxes themselves, so that it was enough to click on the 
> > > > > > > > > cells
> > > > > > > > > surrounding the checkboxes in order to get them checked / 
> > > > > > > > > unchecked.
>
> > > > > > > > > Ricardo do you think you could manage something like that? 
> > > > > > > > > (I'm only
> > > > > > > > > an apprentice and I don't have your expertice!)
>
> > > > > > > > > On 12 Apr, 22:31, jscripter <pc88m...@gmail.com> wrote:
>
> > > > > > > > > > Hey - this is great work - I just happened to be looking 
> > > > > > > > > > for this
> > > > > > > > > > functionality.
>
> > > > > > > > > > How would you apply what you have done here to re-writing 
> > > > > > > > > > the original
> > > > > > > > > > X-library code that uses TDs for the checkbox label?
>
> > > > > > > > > > Thanks!
>
> > > > > > > > > > On Apr 12, 2:04 pm, Ricardo <ricardob...@gmail.com> wrote:
>
> > > > > > > > > > > Sure! I have a few other plugins I also want to upload, 
> > > > > > > > > > > I'll do that.
>
> > > > > > > > > > > I took the time to rewrite it more carefully. No more 
> > > > > > > > > > > binding/
> > > > > > > > > > > unbinding, a single var, all namespaced and bugs ironed 
> > > > > > > > > > > out (if you
> > > > > > > > > > > put the cursor away while holding the button, the 
> > > > > > > > > > > mouseover would
> > > > > > > > > > > remain active even after mouseup).
>
> > > > > > > > > > > The advantage of namespacing is you can easily remove all 
> > > > > > > > > > > event
> > > > > > > > > > > handlers. I included that in the plugin, in the example 
> > > > > > > > > > > you can use $
> > > > > > > > > > > ('ul').dragCheck(false) to disable it completely.
>
> > > > > > > > > > >http://jsbin.com/amoxi/edit
>
> > > > > > > > > > > cheers,
> > > > > > > > > > > - ricardo
>
> > > > > > > > > > > On Apr 12, 9:48 am, Lwangaman <donjohn.f...@gmail.com> 
> > > > > > > > > > > wrote:
>
> > > > > > > > > > > > @Ricardo
> > > > > > > > > > > > Do you think it could be useful to add this to the 
> > > > > > > > > > > > jquery plugins at
> > > > > > > > > > > > plugins.jquery.com? I'd say it could be put under your 
> > > > > > > > > > > > name because
> > > > > > > > > > > > you did all the big work!
>
> > > > > > > > > > > > On 12 Apr, 14:35, Lwangaman <donjohn.f...@gmail.com> 
> > > > > > > > > > > > wrote:
>
> > > > > > > > > > > > > Ok that works better, I just changed "clicked.checked 
> > > > > > > > > > > > > = !isChecked" to
> > > > > > > > > > > > > "clicked.checked = isChecked":
>
> > > > > > > > > > > > >http://jsbin.com/idihi/edit
>
> > > > > > > > > > > > > On 12 Apr, 08:11, Ricardo <ricardob...@gmail.com> 
> > > > > > > > > > > > > wrote:
>
> > > > > > > > > > > > > > The problem with your fix is that the event target 
> > > > > > > > > > > > > > for the mouseup is
> > > > > > > > > > > > > > not the same as the mousedown. You can resolve that 
> > > > > > > > > > > > > > by saving the
> > > > > > > > > > > > > > clicked checkbox in a var, and because of event 
> > > > > > > > > > > > > > order the change has
> > > > > > > > > > > > > > to be made on 'click' rather than mouseup.
>
> > > > > > > > > > > > > >http://jsbin.com/asizu/edit
>
> > > > > > > > > > > > > > Sorry for the bugs, this was written rather 
> > > > > > > > > > > > > > quickly, I hope it works
> > > > > > > > > > > > > > now :)
>
> > > > > > > > > > > > > > On Apr 11, 11:30 am, Lwangaman 
> > > > > > > > > > > > > > <donjohn.f...@gmail.com> wrote:
>
> > > > > > > > > > > > > > > Ok I tried to touch up the code a little to fix 
> > > > > > > > > > > > > > > that, here's my
> > > > > > > > > > > > > > > example:
>
> > > > > > > > > > > > > > >http://jsbin.com/iyubi/edit
>
> > > > > > > > > > > > > > > Now, with a single click, the value on mouseup is 
> > > > > > > > > > > > > > > reversed to keep it
> > > > > > > > > > > > > > > as it was with mousedown. But, when you do a 
> > > > > > > > > > > > > > > drag, the mouseup of the
> > > > > > > > > > > > > > > last checkbox is not canceled or reversed... I 
> > > > > > > > > > > > > > > suppose it would be
> > > > > > > > > > > > > > > enough to cancel $(this)'s mouseup, but how would 
> > > > > > > > > > > > > > > you refer to $(this)
> > > > > > > > > > > > > > > from within the $boxes.bind('mouseover')?
>
> > > > > > > > > > > > > > > On 11 Apr, 16:07, Lwangaman 
> > > > > > > > > > > > > > > <donjohn.f...@gmail.com> wrote:
>
> > > > > > > > > > > > > > > > Hmm, just noticed one problem though... A 
> > > > > > > > > > > > > > > > single click on a checkbox
> > > > > > > > > > > > > > > > is supposed to work too, but with this code as 
> > > > > > > > > > > > > > > > soon as you mouseup the
> > > > > > > > > > > > > > > > value goes back the other way... You have to 
> > > > > > > > > > > > > > > > drag off in order to keep
> > > > > > > > > > > > > > > > the value in there...
>
> > > > > > > > > > > > > > > > On 11 Apr, 06:21, Ricardo 
> > > > > > > > > > > > > > > > <ricardob...@gmail.com> wrote:
>
> > > > > > > > > > > > > > > > > I think you already got the .dc namespacing 
> > > > > > > > > > > > > > > > > thing, so: the mousedown
> > > > > > > > > > > > > > > > > is not being bound to the checkbox, but to 
> > > > > > > > > > > > > > > > > the container element (the
> > > > > > > > > > > > > > > > > table, or in my example below, the UL). When 
> > > > > > > > > > > > > > > > > you click a checkbox the
> > > > > > > > > > > > > > > > > mousedown event will bubble up to the 
> > > > > > > > > > > > > > > > > container and fire this handler.
>
> ...
>
> leggi tutto

Reply via email to