Take the 2-minute tour ×

I'm struggling to get this to work:

var selectorBox = $('<label for="'+selectorID+'"><input type="checkbox" id="'+selectorID+'" name="'+selectorID+'" class="selector" data-inline="true" data-iconpos="notext"></label>').trigger('create'),
    cell = $( "<th class='persist essential notxtchkbx rowHigh' "+rowSpanner+"></th>" ).append( selectorBox );

currentRow.prepend( cell );

selectorBox is the checkbox HTML, which I'm trying to enhance by trigger("create") before creating a cell and inserting this cell in a table row.

How do I get this checkbox to render properly?

Thanks for help!

share|improve this question
I can't see what you are trying to achieve with .trigger('create'). In the absence of a 'create' event, this will do nothing at all. –  Beetroot-Beetroot Sep 28 '12 at 21:23
Just got it to work. I need to call trigger("create") on the parent element. In my case the TH cell. Calling it directly on the checkbox does not work. –  frequent Sep 28 '12 at 21:33
Then post the answer below ;), not in the comments. –  Calavoow Sep 29 '12 at 9:55
give me a few mins. Writing it up in the moment... –  frequent Sep 29 '12 at 10:34

1 Answer 1

up vote 1 down vote accepted

To enhance a checkbox you will need to call trigger("create") on its parent element. Calling it directly on the checkbox does not work. Just use something like:


And it should work.

share|improve this answer

Your Answer


