How do you determine the records being passed to the Data Tables in the Editor?

How do you determine the records being passed to the Data Tables in the Editor?

webmanwebman Posts: 25Questions: 1Answers: 0
edited March 2021 in Free community support

Cant substantiate this code since I get a conflict from code from the editor


oTable = $('#installfee').dataTable({ "bJQueryUI": true, "sPaginationType": "full_numbers", "iDisplayLength": 25, "aLengthMenu": [[25, 50, 100], [25, 50, 100]] }); $('div.container').removeClass('hidden');

Edited by Kevin: I made corrections to your markdown. You need to use backticks (```). You can follow tha up with js for Javascript highlighting.

Replies

  • webmanwebman Posts: 25Questions: 1Answers: 0

    Since I am call the name twice if I use this block of code

  • kthorngrenkthorngren Posts: 20,322Questions: 26Answers: 4,774

    Sorry, I'm not clear on the question/problem. Please provide more details of the issue. Can you provide a link to your page or a test case showing the issue?
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

    Kevin

  • webmanwebman Posts: 25Questions: 1Answers: 0

    The title states how can you determine the amount of records in your datatable query
    Using editor

  • webmanwebman Posts: 25Questions: 1Answers: 0
    edited March 2021

    commented code doesnt work

    JS code

     $(document).ready(function () {
                //oTable = $('#installfee').dataTable({
                //    "bJQueryUI": true,
                //    "sPaginationType": "full_numbers",
                //    "iDisplayLength": 25,
                //    "aLengthMenu": [[25, 50, 100], [25, 50, 100]]
                //});
                //$('div.container').removeClass('hidden');
                editor = new $.fn.dataTable.Editor({                              
                    ajax: "/InstallFees/GetData",
                    table: "#installfee",
                    idSrc: "InstallFeeId",
                    fields: [{
                        label: "Install Fee ID:",
                        name: "InstallFeeId"
                    }, {
                        label: "Installer Code:",
                        name: "InstallerCode"
                    }, {
                        label: "Region:",
                        name: "Region"
                    }, {
                        label: "Town Name:",
                        name: "TownName"
                    }, {
                        label: "Service Code:",
                        name: "ServiceCode"
                    }, {
                        label: "Price Per Foot:",
                        name: "PricePerFoot"
                    }, {
                        label: "Piping Fee:",
                        name: "PipingFee"
                    }, {
                        label: "Price Per Foot2:",
                        name: "PricePerFoot2"
                    }, {
                        label: "Price Per Foot3:",
                        name: "PricePerFoot3"
                    }, {
                        label: "Lower Limit2:",
                        name: "LowerLimit2"
                    }, {
                        label: "Lower Limit3:",
                        name: "LowerLimit3",
                    }, {
                        label: "Two Inch Equivalent Fee:",
                        name: "TwoInchEquivalentFee"
                    }, {
                        label: "Main Line:",
                        name: "MainLine"
                    }
                    ]
                });
    
  • colincolin Posts: 15,146Questions: 1Answers: 2,586

    I'm sorry, but I'm with Kevin here, I'm not understanding your question. Please can you expand on what you want, repeating the same words doesn't help us to help you.

    If you're asking how many records are in the table, use rows().count(). If you want the ajax returned from the server, you can use ajax.json(), but I suspect neither of these are what you're after...

    With the code above, you've commented out the table part of the initialisation. This is needed as the table needs to be there for Editor to edit.

    Colin

  • webmanwebman Posts: 25Questions: 1Answers: 0

    I want to add this control to the editor

  • kthorngrenkthorngren Posts: 20,322Questions: 26Answers: 4,774

    Are you asking about the + Create new record or the length menu? If the length menu see this FAQ. If this doesn't help then please provide a test case showing the issue so we can understand what you are asking for. Here is an Editor example you can start with:
    http://live.datatables.net/guwafemu/178/edit

    Kevin

  • webmanwebman Posts: 25Questions: 1Answers: 0

    Show entries I want to add more than 10 records

  • kthorngrenkthorngren Posts: 20,322Questions: 26Answers: 4,774

    Did you look at the FAQ I linked to?

    Kevin

  • webmanwebman Posts: 25Questions: 1Answers: 0

    Thank you this is what I was looking for

This discussion has been closed.