The below code works fine for me,
$("#ButtonId").click(function () {
jQuery("#gridId").jqGrid('editGridRow', "new", { height: 330, width: 350, addCaption: "Add form", recreateForm: true, closeAfterAdd: true });
});
In the above, you can give the height & width as you need. The same thing for edit form too.