Skip to content

calControlGroup isn't "smart" enough #256

Closed
patricker opened this Issue Apr 1, 2013 · 7 comments

2 participants

@patricker

I'm having a lot of trouble with the calControlGroup option on calbox. The only code I can find that uses this in calbox is below.

When I use this option it doesn't appear to do anything, nor does the code appear to be sensitive to the location in the list of items, or two horizontal vs vertical type controlgroups. I was really hoping to use this in a control group, but it isn't visually formatting it self correctly at all.

if ( o.calControlGroup === true ) {
hRow.find('.ui-corner-all').removeClass('ui-corner-all').eq(0).addClass('ui-corner-left').end().last().addClass('ui-corner-right').addClass('ui-controlgroup-last');
}

@jtsage
Owner
jtsage commented Apr 3, 2013

I'm not sure I follow - are you saying you want the datebox original input in a control group?

@jtsage
Owner
jtsage commented Apr 3, 2013

As an aside to that, calControlGroup is supposed to group the rows of date buttons together in the picker UI. Now, I do notice that it is properly grouping (removing padding, border radius, etc), however, it is not currently adding the rounding to the first/last element as it should... I'll work on that.

@patricker

Yes, I want the datebox input in a control group... When I saw the control group option this is what I assumed it meant.

Maybe I could get something similar anyways, just no textbox, by using a button in the control group. When you click the button it shows the date picker and sets the button text to the selected date.

@jtsage
Owner
jtsage commented Apr 4, 2013

ah, that makes sense. Yeah, what you suggest is possible - let me think about the best way to handle it - i'll have something for you in a day or two.

@jtsage
Owner
jtsage commented Apr 4, 2013

I added a demo, at: http://dev.jtsage.com/jQM-DateBox2/demos/opt/open.html

It's the last one in the collapsible list - it has 3 pretty simple versions of datebox being "part" of a control group. (It's not really - but the open button absolutely could be.)

The problem is, the input element is absolutely integral to how datebox works. And although I could probably hide it, and attempt to add a button automatically, I'd still need to duplicate at least some of the added class markup that jQM will do when it makes a control group - which of course, means that it will probably break every time there is a new version upstream. The demonstrated method however should be compatible for the foreseeable future though.

@patricker

Great examples, I appreciate it. I think that will work for what I want.
FYI: The top and bottom examples work, but the middle one doesn't do anything when I click it. Bottom one is what I was looking for, so I'm happy. Thanks again.

@jtsage
Owner
jtsage commented Apr 4, 2013

Excellent - glad this helps. Middle one is/was a typo on the id attribute. whoops.

@jtsage jtsage closed this in f399d85 Apr 4, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.