2016-03-12关于datatables和editor一些功能使用上的总结

乐健
2023-12-01

1.       editor的某个字段设置默认值使用def:

2.      添加编辑删除放在一行内

//new

      $('a.editor_create').on('click', function (e){

        e.preventDefault();

        editor.create( {

            title: 'Create newrecord',

            buttons: 'Add'

        } );

    } );

 

    // Edit record

    $('#example').on('click''a.editor_edit', function (e){

        e.preventDefault();

 

        editor.edit( $(this).closest('tr'), {

            title: 'Editrecord',

            buttons: 'Update'

        } );

    } );

 

    // Delete a record

    $('#example').on('click''a.editor_remove', function (e){

        e.preventDefault();

 

        editor.remove( $(this).closest('tr'), {

            title: 'Deleterecord',

            message: 'Are yousure you wish to remove this record?',

            buttons: 'Delete'

        } );

    } );

 

3.      增删改查调用自己写php

 

 create: {

                type: 'POST',

                url:  '../php/rest/create.php'

            },

            edit: {

                type: 'PUT',

                url:  '../php/rest/edit.php?id=_id_'

            },

            remove: {

                type: 'DELETE',

                url:  '../php/rest/remove.php?id=_id_'

            }

4.      多文件上传【https://editor.datatables.net/examples/advanced/upload-many.html

5.      导出exsel【https://editor.datatables.net/examples/extensions/exportButtons.html】

6.      可拖拽【https://editor.datatables.net/examples/extensions/rowReorder.html】

7.      行内编辑【https://editor.datatables.net/examples/inline-editing/simple.html】

8.      焦点离开后【https://editor.datatables.net/examples/inline-editing/options.html】

9.      有按钮的点击【https://editor.datatables.net/examples/inline-editing/submitButton.html】

10.  行内编辑,如何区分该字段是否可以编辑,比如一个表显示用到两张表,但是只有一张表可以编辑,可以编辑的加一个className就可以【https://editor.datatables.net/examples/inline-editing/columns.html】。

   $('#example').on( 'click', 'tbody td.editable', function (e) {

       editor.inline( this );

} );

11.  datatables显示在一个框内和弹出泡泡框编辑【https://editor.datatables.net/examples/bubble-editing/simple.html】

12.  行内删除

 

 $('#example').on( 'click''a.remove', function (e){

        editor

            .title( 'Delete row' )

            .message( 'Are yousure you wish to delete this row?' )

            .buttons( { "label""Delete""fn": function () {editor.submit() } } )

            .remove( $(this).closest('tr') );

    } );

 

13.  依赖字段【https://editor.datatables.net/examples/api/dependentFields.html】

14.  自定义按钮功能,实现可以由自己实现。【https://editor.datatables.net/examples/api/triggerButton.html】

15.  编辑渲染退出按钮,cancel

【https://editor.datatables.net/examples/api/cancelButton.html】

16.  Checkbox选中状态

【https://editor.datatables.net/examples/api/checkbox.html】

17.  复制某行记录

【https://editor.datatables.net/examples/api/duplicateButton.html】

18.  自定义删除信息

【https://editor.datatables.net/examples/api/removeMessage.html】

19.  编辑框变大

【https://editor.datatables.net/examples/styling/large.html】

20.  类似附加信息,点击加号编辑。

【https://editor.datatables.net/examples/plug-ins/displayController.html】

21.  Bootstrap样式的东西

https://editor.datatables.net/examples/styling/bootstrap.html】

22.  表格切化,多个tab里面有表格【http://datatables.net/release-datatables/examples/api/tabs_and_scrolling.html】

23.  文本框搜索(已经运用

【http://datatables.net/release-datatables/examples/api/multi_filter.html】

24.  下拉框搜索(已经运用

【http://datatables.net/release-datatables/examples/api/multi_filter_select.html】

25.  行列高亮

【http://datatables.net/release-datatables/examples/api/highlight.html】

26.  详细信息

【http://datatables.net/release-datatables/examples/api/row_details.html】

27.  多语言

【http://datatables.net/release-datatables/examples/advanced_init/language_file.html】

28.  点中既搜索

【http://datatables.net/release-datatables/examples/api/api_in_init.html】

29.  总计

【http://datatables.net/release-datatables/examples/advanced_init/footer_callback.html】

30.  列回调函数

【http://datatables.net/release-datatables/examples/advanced_init/row_callback.html】

31.  控制dom位置

【http://datatables.net/release-datatables/examples/advanced_init/dom_multiple_elements.html】

32.  按组显示行

【http://datatables.net/release-datatables/examples/advanced_init/row_grouping.html】

33.  默认补充12几条

34.  追加字段

                   //追加一个批量字段

                   editor.add({

                            "label":"批量",

                            "name":"f_bulk", //batch

                            "type":"checkbox",

                            "separator":"|",

                            "ipOpts":[{

                                     "label":"\u6279\u91cf\u589e\u52a0",

                                     "value":"1"

                            },]

                   });

35.  追加进去的字段往前放

                   //2016-03-1010:53暂时注释

                   varorder = editor.order();

                   order.unshift(order.pop() ); // move the last field into the first position

                   editor.order(order );

36.  字段的提示属性

editor.add({

                    "label": "长度",

                    "name":"f_table_cnt",

                    "default":"1",

                    "fieldInfo":""

           });

37.   

 

 类似资料: