Jquery Mobile - 在关闭事件之前弹出

时间:2017-04-13 09:44:51

标签: jquery jquery-mobile

我试图在触发关闭事件时运行一些检查(此代码正在运行),并且如果发现任何错误(并显示消息),则阻止弹出窗口关闭。

似乎JQM在关闭事件(或类似事件)之前没有。有可能这样做吗?

这是弹出窗口的HTML代码:

<div id="divPropertyPopup"
     class="ui-content form-horizontal"
     data-role="popup"
     data-overlay-theme="a"
     data-dismissible="false"
     style="min-width:30em; padding: 1em;">
    <a href="#" data-rel="back" data-role="button" data-theme="a" data-icon="delete" data-iconpos="notext"
       class="ui-btn-right">Close</a>
    <h4>Edit Optional Field Properties</h4>

    <div id="view_edit" data-role="fieldcontain" class="hidden">
        <div data-role="fieldcontain">
          <label style="padding: 0 !important; text-align: left !important;" class="preview_label"
                 for="functionmode">Form Function Mode</label>

          <select class="form-control" id="functionmode" title="Form Function Mode">
            <option value="edit">Edit Mode</option>
            <option value="view">View Mode</option>
          </select>
        </div>
    </div>

    <div data-role="fieldcontain" id="descriptionRow">
        <label class="preview_label"
               for="property_desc">Description</label>
        <input type="text"
               class="fieldproperty"
               id="property_desc"
               title="Description"/>
    </div>

    <div data-role="fieldcontain">
        <label class="preview_label"
               for="property_inst">Instructions</label>
        <input type="text"
               class="fieldproperty"
               id="property_inst"
               title="Instructions"/>
    </div>

    <div data-role="fieldcontain">
        <label class="preview_label"
               for="property_keyw">Keywords</label>
        <input type="text"
               class="fieldproperty"
               id="property_keyw"
               title="Keywords - Separated by commas"/>
    </div>

    <div data-role="fieldcontain">

        <label class="preview_label"
               for="property_unique"
               style="width: 100%; text-align: left">Unique Field Identifier</label>
        <input type="text"
               class="fieldproperty"
               id="property_unique"
               title="Unique Field Identifier - Separated by commas"/>
    </div>

    <div data-role="fieldcontain" id="mandatoryRow">
        <label style="padding: 0 !important;" class="preview_label"
               for="property_mand">Mandatory</label>
        <input type="checkbox"
               class="fieldproperty form-control"
               id="property_mand"
               title="Mandatory Status"/>
    </div>


    <div class="row" id="limitsRow">
        <div class="col-lg-6 col-md-6 col-sm-12">
            <div data-role="fieldcontain">
                <label class="preview_label"
                       for="property_min">Min</label>
                <input type="text"
                       class="fieldproperty"
                       id="property_min"
                       title="Minimum Value"/>
            </div>
        </div>

        <div class="col-lg-6 col-md-6 col-sm-12">
            <div data-role="fieldcontain">
                <label class="preview_label"
                       for="property_max">Max</label>
                <input type="text"
                       class="fieldproperty"
                       id="property_max"
                       title="Maximum Value"/>
            </div>
        </div>
    </div>
</div>
<!-- popup -->

0 个答案:

没有答案