Inlineediting functionality

Inlineediting functionality

c-oletic-oleti Posts: 4Questions: 1Answers: 0

Hi,i am not able to save the update value in inline editing or edit button in java.

This question has accepted answers - jump to:

Answers

  • allanallan Posts: 63,810Questions: 1Answers: 10,516 Site admin
    Answer ✓

    Have you implemented the required client / server communication in your Java server-side?

    Allan

  • c-oletic-oleti Posts: 4Questions: 1Answers: 0

    Hi allan thanks for giving for reply i am done implementation for inline.

  • c-oletic-oleti Posts: 4Questions: 1Answers: 0

    Hi allan i want to know one thing when i am adding sDom: 'lfrtip', top of the table dropdown button is displayed but edit and remove buttons are hidden.can u please let me know how can i make visible both dropdown and edit button

  • allanallan Posts: 63,810Questions: 1Answers: 10,516 Site admin

    Each letter in the dom parameter is a feature. B is the character for Buttons and it tells DataTables where to put the Buttons. You don't have a B in the above, hence the issue. I'd suggest reading over the dom docs, as it is a complex property that one.

    Allan

  • c-oletic-oleti Posts: 4Questions: 1Answers: 0

    Hi allan,

    Still i am not able to resolve the issue please find the attachments,
    For display the number of records in a page i mentioned as dropdown box "dom": 'lrtip' a and if i mentioned that Edit and Remove buttons are not displayed.

    This is my code

    var editor; // use a global for the submit and return data rendering in the examples

    $(document).ready(function() {

    alert("jjj");
    
    editor = new $.fn.dataTable.Editor( {
        ajax: "hello.do?method=getJson",
        table: "#example",
        idSrc:  'rowid',
        fields: [ {
            label: "Rowid:",
            name: "rowid"
        },             
                  {
                label: "Contract Duration:",
                name: "contract_duration"
            }, {
                label: "Description:",
                name: "description"
            }, {
                label: "Price:",
                name: "price"
            }, {
                label: "Frequency:",
                name: "frequency"
            }, {
                label: "Discount Description:",
                name: "discount_description"
            }, {
                label: "Discount Value:",
                name: "discount_value"
            }, {
                label: "EUR:",
                name: "EUR"
            }, {
                label:"Discount Duration:",
                name:"discount_duration"
            }, {
                label:"Net Price:",
                name:"net_price"
            }
        ]
    } );
    
    
    $('#example').on( 'click', 'tbody td:not(:first-child)', function (e) {
        editor.inline( this, {
            onBlur: 'submit'
        } );
    } );
    
    $('#example').DataTable( {
        dom: "Bfrtip",
        dom: '<lf<t>ip>',
        ajax: "hello.do?method=getJson",
        idSrc:  'rowid',
        columns: [
            {
                data: null,
                defaultContent: '',
                className: 'select-checkbox',
                orderable: false
            },
             {data: "rowid" },
            { data: "contract_duration" },
            { data: "description" },
            { data: "price" },
            { data: "frequency" },
            { data: "discount_description", 
              defaultContent: "<i>Not set</i>"
            },
            { data: "discount_value" },
            { data: "EUR" },
            { data: "discount_duration" },
            { data: "net_price", render: $.fn.dataTable.render.number( ',', '.', 0, '$' ) }
        ],
        order: [ 1, 'asc' ],
        select: {
            style:    'os',
            selector: 'td:first-child'
        },
       buttons: [            
            { extend: "edit",   editor: editor },
            { extend: "remove", editor: editor }
        ]
    } );
    

    } );

  • allanallan Posts: 63,810Questions: 1Answers: 10,516 Site admin
    Answer ✓
    dom: "Bfrtip",
    dom: '<lf<t>ip>',
    

    You can't define the same parameter twice - it would be like trying to say: var i=0; i=1; and expecting i to be both 0 and 1!

    I would suggest in the first instance you use:

    dom: "Bfrtip",
    

    as your starting point and then simply add the l option in that string. Perhaps immediately after the B for example.

    Alternatively use the pageLength button type, as shown and explained in this example.

    Allan

This discussion has been closed.