Quantcast
Channel: DataTables 1.10 — DataTables forums
Viewing all 2364 articles
Browse latest View live

How do you distinguish which host field is used when using an array on editor.dependent

$
0
0

How do you distinguish which host field is used when using an array on editor.dependent? The only variable that seems to be available for this is val which only gives the value of the host field, but not the name of the host field.

editor.dependent( ['vendor_number','vendor_fname','vendor_lname], function(val,data,callback) {
    alert(val);   //val only provides value of the field. How do I find out which host field is being used. 

        },
    { 
        event: 'keyup'
    }
    
    
    );

tfoot is null

$
0
0

Need help on why table tfoot is null...
Dattatables create thead but not tfoot.
Thanks

Data security issue

$
0
0

I have successfully installed Datatables 1.10 and website is alive and running.

However, all php files can be directly accessed by visitors compromising the security of the data. I have retained directiory structure of the php files for instance,

    "ajax": "examples/server_side/scripts/co-objects.php"

How do I prevent direct access of the php file?

How to use EXTERNAL jquery datpicker to cause ajax to refrsh data table with different information

$
0
0

I added a datepicker to allow users to change the filter set on a (large) database. I want the datepicker to cause an ajax refresh to my table. (passed parameters are an ID and an integer date code of the format yyyymm. The ajax function called is the one which initially loads the page.
Here is my code:

       var dirTable = $("#dirTable").DataTable( {
            dom: "Bflrtip",
            "serverSide": false,
            ajax:   {
                "url":  "/components/com_insight/ajax/resource/ajaxDirDetail.php",
                "type": "POST",
                data: function(d) {
                    d.dirId="' . $dirId .'";
                    d.dateCode="'.$dateCode.'";
                }                                
            },............

        $(function() {
            $(".date-picker").datepicker( {
                yearRange: "2015:" + new Date().getFullYear(),
                dateFormat: "yyyymm",
                changeMonth: true,
                changeYear: true,
                showButtonPanel: true,
                dateFormat: "MM yy",
                onClose: function(dateText, inst) {
                    var month = $("#ui-datepicker-div .ui-datepicker-month :selected").val();
                    var year = $("#ui-datepicker-div .ui-datepicker-year :selected").val();
                    $(this).datepicker("setDate", new Date(year, month, 1));
                    var monthcode = (month*1+1);
                    var sMonthCode = monthcode.toString();
                    if (sMonthCode.length =1) {sMonthCode = 0+sMonthCode}
                    var dateCodeParam = year+sMonthCode;
                    var selDirId = document.getElementById("dirId");
                    var selDir = selDirId.options[selDirId.selectedIndex].value;
                    //alert(dateCodeParam + " " + selDir);
                    $.ajax({
                        url: "/components/com_insight/ajax/resource/ajaxDirDetail.php",
                        type: "POST",
                        data: { dirId:selDir, dateCode: dateCodeParam},
                        success: function(result){
                                $("#dirTable").DataTable.clear();
                                $("#dirTable").DataTable.draw();
                                $("#dirTable").DataTable.rows.add(result);
                $("#dirTable").DataTable.draw();
                        }
                     });
                }
            });
        });

My attempt to redraw the table
success: function(result){ $("#dirTable").DataTable.clear(); $("#dirTable").DataTable.draw(); $("#dirTable").DataTable.rows.add(result); $("#dirTable").DataTable.draw();

leads to an unknown function error. I am sure I have the context inccorect, but I do not know how to fix this. Any help would be appreciated!

Destroy table troubles

$
0
0

I'm not sure why I'm having so much trouble with this.. I'm trying to destroy a table. The error is: Uncaught TypeError: Cannot read property 'dt' of undefined

Code:

I have a function that's triggered by a dropdown select menu.

var table

function onChange() {

if ( table != null ) {
    table.destroy();
    $("#weeklySalesTable").empty();
}

...

table = $('#weeklySalesTable').DataTable( {
                          "scrollY": "600px",
                          "scrollX": true,
                          "paging": true,
                          "lengthMenu": [ [25, 50, 100], [25, 50, 100] ],
                          "info": true,
                          "deferRender": true,
                          "ordering": false,
                          "fixedColumns":   true,
                          "scrollCollapse": true,
                    } );

}

When serving datatables over https I'm getting net::ERR_CONTENT_LENGTH_MISMATCH

$
0
0

When I'm trying to load datatables over https I sometimes get et::ERR_CONTENT_LENGTH_MISMATCH in chrome.
Which results in not loading datatables/datatables editor.

This is what the log spits out:

GET https://mydomain.com/include/js/external/jquery.dataTables.min.js net::ERR_CONTENT_LENGTH_MISMATCH
GET https://mydomain.coml/include/editor/js/dataTables.editor.min.js net::ERR_CONTENT_LENGTH_MISMATCH

dataTables.bootstrap.min.js:5 Uncaught TypeError: Cannot read property 'defaults' of undefined(anonymous function) @ dataTables.bootstrap.min.js:5(anonymous function) @ dataTables.bootstrap.min.js:5(anonymous function) @ dataTables.bootstrap.min.js:5
dataTables.buttons.min.js:5 Uncaught TypeError: Cannot read property 'ext' of undefined(anonymous function) @ dataTables.buttons.min.js:5(anonymous function) @ dataTables.buttons.min.js:5(anonymous function) @ dataTables.buttons.min.js:5
buttons.bootstrap.min.js:5 Uncaught TypeError: Cannot read property 'Buttons' of undefined(anonymous function) @ buttons.bootstrap.min.js:5a @ buttons.bootstrap.min.js:5(anonymous function) @ buttons.bootstrap.min.js:5
editor.bootstrap.min.js:5 Uncaught TypeError: Cannot read property 'Editor' of undefined(anonymous function) @ editor.bootstrap.min.js:5(anonymous function) @ editor.bootstrap.min.js:5(anonymous function) @ editor.bootstrap.min.js:5
dataTables.responsive.min.js:22 Uncaught TypeError: Cannot read property 'Api' of undefined(anonymous function) @ dataTables.responsive.min.js:22(anonymous function) @ dataTables.responsive.min.js:5(anonymous function) @ dataTables.responsive.min.js:5
responsive.bootstrap.min.js:5 Uncaught TypeError: Cannot read property 'Responsive' of undefined(anonymous function) @ responsive.bootstrap.min.js:5(anonymous function) @ responsive.bootstrap.min.js:5(anonymous function) @ responsive.bootstrap.min.js:5
dataTables.select.min.js:11 Uncaught TypeError: Cannot set property 'select' of undefined(anonymous function) @ dataTables.select.min.js:11(anonymous function) @ dataTables.select.min.js:5(anonymous function) @ dataTables.select.min.js:5
alt-string.js:18 Uncaught TypeError: Cannot read property 'oSort' of undefined(anonymous function) @ alt-string.js:18
myjsfile.js:1 Uncaught TypeError: Cannot read property 'oSort' of undefined(anonymous function) @ myjsfile.js:1
myotherjsfile.js:1 Uncaught TypeError: Cannot read property 'oSort' of undefined(anonymous function) @ myotherjsfile.js:1
andanotherjsfile.js:89 Uncaught TypeError: Cannot read property 'oSort' of undefined

pagelenght callback

Positioning scrollbar and rounded edges

$
0
0

Hi all. I am using datatables with server side scripting and bootstrap. I need to have scrolling enabled but with the scrollbar positionined "within" the table. i.e. underneath the last table column. At the moment all I'm able to get is the scrollbar working outside the table as is displayed in this link

http://live.datatables.net/fopilode/1/edit

Is this possible ?

I'm trying to acieve something like this :

http://issues.wenzhixin.net.cn/bootstrap-table/#options/basic-columns.html

Another issue I'm trying to resolve is getting the rounded edges on the table using the bootstrap css. Any bootstrap aficionados have some ideas regarding this ?

Thanks in advance people.


Overriding the $sql_details in order to connect to a different database.

$
0
0

We have a scenario whereby certain DataTables/Editor instances need to connect to a different database. Is there a way to deal with this? I need to override the default $sql_details settings in config.php.

help on compose dtRowId

$
0
0

@Allan . I need help to find where i can compose the rowId based on an array or object .
ex:
dtrowid='DtRow_id
$.each(primaryPk,function(pk,value){
dtrowid=dtrowid + '_' + value
}

for composite keys purposes.
thanks

Make child rows by class name declaration NOT ajax data source

$
0
0

I am trying to get a complex jquery datatable working to have multiple child rows per parent - not from ajax - but from a class declaration on the table which are dynamically generate rows on page load. I don't want them to be collapsible - just becoming ignored in the sorting, and remain attached to their parent row.

Here is the full example with jsfiddle:

http://stackoverflow.com/questions/36396742/jquery-datatables-make-child-rows-by-class-name-declaration-not-ajax-data-sour

Thanks for your assistance.

how to remove auto sort after inline update?

$
0
0

how to remove auto sort after inline update?

i have default sort by date_modify, when i edit row inline it jump to top of table.. because table is resorting it self by date_modify
i want this row to remain in place

have this function to the new version editor?

$
0
0

jQuery.fn.dataTable.Api.register('row.addByPos()', function(data, index) {
var currentPage = this.page();

//insert the row
this.row.add(data);

    //move added row to desired index
    var rowCount = this.data().length-1,
        insertedRow = this.row(rowCount).data(),
        tempRow;

    for (var i=rowCount;i>=index;i--) {
        tempRow = this.row(i-1).data();
        this.row(i).data(tempRow);
        this.row(i-1).data(insertedRow);
    }

    //refresh the current page
    this.page(currentPage).draw(false);
});

i want now to add new row in some position (index) its possible?

$
0
0

i want now to add new row in some position (index)
its possible?

minimize gray top-bottom area

$
0
0

the datatables table has a top and a bottom area, used for the display of "Show 10 entries" and "Showing 10 of 57 entries" and "Previous 1 2 3 Next". Depending on user configurable settings, my users don't see these displays but the empty gray areas that would contain them are still there. Where do I have to tweak to make them go away?


.draw() removes jquery .change()

$
0
0

When I fire the .draw() it removes all the bindings I initialized when the table was loaded. I tried .draw(false) and that did not stop it from removing my binds.

Is there a function I can call to reinitialize my jquery bindings?

redraw table without ajax call and using local array

$
0
0

I am using server side processing and when i do myTableName.tbl.clear().draw(false) ajax is fired again.
How can i prevent ajax call on draw()?
myTableName.editor.on('submitComplete', function (e, data, action) {
var tbdata=myTableName.tbl.data();
debugger;
console.log(this.s.action)
if(this.s.action=='edit'){
}
if(this.s.action=='create'){
tbdata.push(data);
}
myTableName.tbl.clear().draw(false);
myTableName.tbl.rows.add(tbdata);

i know that this cant be done with server side processing. At least can i send a paramenter to server to return nothing and clear table? Can i do this with a search that returns nothing?

Which is the best way in your opinion?

http://www.quad-systems.pt/QUAD_HCM/#ajax/datatablePROTODocs.php

debug code : ipehan

Columns.Render - Accessing data for more than 1 column in the render function

$
0
0

Hi all,

I am using datatables with server side rendering and my render function is as follows for a column in my table :

             {
                    "data": "Errors",
                    "width": "5%",
                    "orderable": false,
                    "render":
                        function (data, type, row) {
                            var myUrl = '@Url.Action("Foo", "Bar")/' + data;
                            return '<a href=\"' + myUrl + '\">'+data+'</a>';

                        }
                }

What I need to do is display the value for the data (which is the errors colum) in my link but pass the value of another column (id) as the parameter when the url is clicked. So for the line var myUrl = '@Url.Action("Foo", "Bar")/' + data; I would like to pass the value of the 'Id' column as data. Is there any way to do this ?

Thanks

Multi-rows Footer

changing serverSide in runtime

$
0
0

how can i change serverSide to false on runtime? And then reinitialize table but not draw? Or not draw and use saveState?
any thoughts

Viewing all 2364 articles
Browse latest View live