验证引擎与jtable匿名函数项单击

时间:2014-08-30 14:36:28

标签: jquery jquery-ui-dialog jquery-validation-engine jquery-jtable

首先非常感谢你的支持并原谅我的英语不好。

我正在尝试在jtable中使用验证引擎,但我遇到了麻烦。

这是我的JTable上的代码

$(document).ready(function() {              
    //setup the jtable that will display the results
    $('#EnvelopeContainer').jtable({
        title: 'Envelope Records',
        selecting: true, //Enable selecting 
        paging: true, //Enable paging
        pageSize:10, //Set page size (default: 10)
        sorting: true, //Enable sorting
        actions: {
            listAction:   'records',
            createAction: 'create',
            updateAction: 'update',
            deleteAction: 'delete'
        },
        fields: {
            id: {
                title: 'ID',
                key: true,
                list: true,
                create: false,
                edit: false
            },
            shiftWork: {
                title: 'Turno',
                width: '12%',
                options: { 'M': 'Mañana', 'T': 'Tarde', 'N' : 'Noche' }
            },
            date: {
                title: 'Fecha',
                width: '15%',
                type: 'date',
                displayFormat: 'dd-mm-yy'
            },
            amount: {
                title: 'Importe',
                width: '15%',
                inputClass: 'validate[required]'
            },
            observation: {
                title: 'Observacion',
                type: 'textarea',
                width: '40%',
                inputClass: 'validate[required]'
            }
        },
        formCreated: function (event, data) {
            data.form.validationEngine('attach', {
                binded: true
            });
        },
        formSubmitting: function (event, data) {
            return data.form.validationEngine('validate');
        },
        formClosed: function (event, data) {
            data.form.validationEngine('hide');
            data.form.validationEngine('detach');
        }
    });


    $('#LoadRecordButton').click(function (e) {
        e.preventDefault();
        $('#EnvelopeContainer').jtable('load', {
            shiftWork: $('#shiftWork').val()
        });
    });

    $('#LoadRecordButton').click();              

});

jquery 1.9.1 jquery ui 1.10.0 jtable 4.2.0

验证引擎2.2

已经在验证引擎中替换了已弃用的方法(实时和死亡),但问题仍在继续。

这是我单位的顺序

<script type="text/javascript" src="/vehiclebusiness/resources/js/jquery/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="/vehiclebusiness/resources/js/jquery/jquery-ui-1.10.0.js"></script>

<script type="text/javascript" src="/vehiclebusiness/resources/js/jtable/jquery.jtable.js"></script>

<script type="text/javascript" href="/vehiclebusiness/resources/js/jquery/validationEngine/jquery.validationEngine.js"></script>
<script type="text/javascript" href="/vehiclebusiness/resources/js/jquery/validationEngine/jquery.validationEngine-en.js"></script>    

消息错误是这样的:

Uncaught TypeError: undefined is not a function ....................(index):84

$.jtable.formCreated  ..............................................(index):84

$.Widget._trigger .....................................jquery-ui-1.10.0.js:790

$.extend._showAddRecordForm .............................jquery.jtable.js:2240

self._addToolBarItem.click ..............................jquery.jtable.js:2067

(anonymous function) ....................................jquery.jtable.js:1048

b.event.dispatch ........................................jquery-1.9.1.min.js:3

v.handle ................................................jquery-1.9.1.min.js:3

0 个答案:

没有答案