resizeable snap to grid

resizeable snap to grid


I can not seem to get the snap to grid feature to work on the below
code snippet... does a fine job of creating a resizable element, but
the snap fails.
$('#'+el).resizable({
ghost:true,
grid:50, // also tried '50px'
// containment:'#layout',
stop:function(){
//refactor redundant!
resizeH = $.evalJSON($('#metacache').text())
var h= $(this).height() + "px"
var w= $(this).width() + "px"
var cur = this.id
jQuery.each(resizeH, function(i,val){
if (i == cur) {
resizeH[i].properties.width = w
resizeH[i].properties.height = h
}
})
EtchaBuilder.metabuild($.toJSON(resizeH))
EtchaBuilder.Grid.format()
}})