Skip to content

Changes in common jqGrid dialogs

Oleg Kiriljuk edited this page Mar 4, 2018 · 10 revisions

Introduction

By default, jqGrid uses jqModal.js and jqDnR.js plugins to create modal dialogs used in different parts of the code, mostly for form editing, in navigator bar and in searching dialog. jqGrid has the methods $.jgrid.createModal, $.jgrid.viewModal, $.jgrid.hideModal, $.jgrid.closeModal, $.jgrid.showModal and $.jgrid.info_dialog which are based on the methods from jqModal.js and jqDnR.js. The methods used in other parts of jqGrid to display modal dialogs.

A common problem with the dialog methods was on closing. By default, jqGrid hid all dialogs instead of destroying them. As a result, the Add/Edit dialog stayed in memory. All event handlers (for onClick events) were still bound. The DOM element of the grid was still in use by the event handlers. The ids with the name of the columns were used as ids of the Add/Edit form and remained in existence on closing the form. All the above behavior can create small and, occasionally, large problems.

Changes in free jqGrid 4.8

The code of jqModal.js and jqDnR.js plugins included in jqGrid 4.7 and earlier is difficult to read and understand. The code looks more like minimized code than the original JavaScript code.

Free jqGrid 4.8 renamed and reformatted the code of jqModal.js and jqDnR.js to make it more readable. Additionally, jqDnR.js was changed to support drag and drop and resizing of dialogs on touch devices like iPad and the touch events of Windows 8.

Free jqGrid changed the behavior on closing of the Add/Edit/Search/Delete form so that the form is destroyed by default on closing. Only the width, height and the position of the corresponding Dialog are saved by default. The next time the dialog is opened, the previous width, height and the position are used. If the recreateForm: true option or recreateFilter: true option is used, then the saved width, height and the position are ignored.