This seems to work ok with this jsfiddle:
http://jsfiddle.net/KEMrX/ It has the following javascript:
$("#grid").on("custom",".grid_elm",function(){
$.each($(".grid_elm"),function(){
console.log($(this));
})
})
//"custom" Event is fired after grid refreshes with new content
$(".grid_elm").trigger("custom");
and the HTML code:
<div id="grid">
<div id="gridMask">
<div id="mCSB_1">
<div class="mCSB_conatiner">
<div class="holder">
<div class="grid_elm"></div>
<div class="grid_elm"></div>
<div class="grid_elm"></div>
<div class="grid_elm"></div>
</div>
</div>
</div>
</div>
</div>
If you look at the console after you run it, you'll see your .grid_elm elements properly printed out.
Most likely you're having problems with the generated content, and not with the custom event handling. When is the #grid element created? When do you run the code that attaches the event on the #grid element?
Edit: The important part is: the code that attaches the event should happen directly after the code that creates(and appends) the #grid element onto the page. Otherwise, the expression $("#grid") will return an empty array, and the .on() function will NOT run on anything.