Opened 9 years ago

Closed 9 years ago

Last modified 8 years ago

#11897 closed enhancement (fixed)

[patch][cla]ComboBox: make styling of options easier

Reported by: rrsipov Owned by: bill
Priority: high Milestone: 1.6
Component: Dijit - Form Version: 1.5
Keywords: Cc: robert.sanders@…
Blocked By: Blocking:

Description

In In the createOptions() function for dijit.form._ComboBoxMenu, the .className attribute of the created items is set directly; this means that simply implementing _createOption() isn't enough to add a custom style to the items, as it is simply overwritten once it is returned to the createOptions() function.

Attached is a patch that uses dojo.addClass() to do the same work, allowing the _createOption function to return a DOM element with a CSS Class already associated with it.

Attachments (2)

dojo-cla.pdf (75.2 KB) - added by rrsipov 9 years ago.
My CLA
ComboBox.js.diff (598 bytes) - added by rrsipov 9 years ago.
Diff File

Download all attachments as: .zip

Change History (7)

Changed 9 years ago by rrsipov

Attachment: dojo-cla.pdf added

My CLA

Changed 9 years ago by rrsipov

Attachment: ComboBox.js.diff added

Diff File

comment:1 Changed 9 years ago by bill

I don't think attaching a blank copy of the CLA form to a ticket, rather than sending a signed copy to cla@dojotoolkit.org, allows you to submit patches, but if you are Robert Sanders then I do see your name on http://docs.dojocampus.org/developer/contributors from a long time ago...

Anyway seems like maybe the

menuitem.className = "dijitReset dijitMenuItem" +
	(this.isLeftToRight() ? "" : " dijitMenuItemRtl");

should be moved from createOptions() into _createOption(), that would also solve your problem right?

comment:2 Changed 9 years ago by rrsipov

Oops. Yes, I guess I added the blank copy of the cla instead of the copy signed copy I had scanned in.

Yes, either approach would work.

comment:3 Changed 9 years ago by bill

Milestone: tbd1.6
Owner: set to bill
Status: newassigned
Summary: [patch][cla]ComboBox make styling of options easier.[patch][cla]ComboBox: make styling of options easier

OK thanks, I'll do that then.

comment:4 Changed 9 years ago by bill

Resolution: fixed
Status: assignedclosed

(In [23123]) Make it easier to override class name setting on ComboBox drop down items, fixes #11897 !strict.

comment:5 Changed 8 years ago by bill

Component: DijitDijit - Form
Note: See TracTickets for help on using tickets.