Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all 81675 articles
Browse latest View live

Date Format validator doesn't work proper

$
0
0

Hi,

I used the generator and created two entries
valid from
valid until
with the German date format "dd.MM.yy".

It works fine for the online preview.

Starting the project leads to the following situation, http://prntscr.com/hvjjxp , where it is possible to store a date like 01.01.18, but not 10.01.18.

The POST request includes

data[0][gueltig_von] 01.01.18
data[0][gueltig_bis] 10.01.18

The result is

{
   "draw":null,
   "data":[

   ],
   "recordsTotal":null,
   "recordsFiltered":null,
   "error":null,
   "fieldErrors":[
      {
         "name":"gueltig_bis",
         "status":"Input not valid"
      }
   ],
   "id":null,
   "meta":{

   },
   "options":{

   },
   "files":{

   },
   "upload":{
      "id":null
   },
   "debugSql":[

   ],
   "cancelled":[

   ]
}

debugSql is empty, also I set

.Debug(true)

in the Controller.cs

The validation in the Controller.cs is

                    .Field(new Field("gueltig_von")
                            .Validator(Validation.DateFormat("dd.MM.yy"))
                            .GetFormatter(Format.DateSqlToFormat("dd.MM.yy"))
                            .SetFormatter(Format.DateFormatToSql("dd.MM.yy"))
                    )
                    .Field(new Field("gueltig_bis")
                            .Validator(Validation.DateFormat("dd.MM.yy"))
                            .GetFormatter(Format.DateSqlToFormat("dd.MM.yy"))
                            .SetFormatter(Format.DateFormatToSql("dd.MM.yy"))
                    )

The type of both dates are "date" in the MS SQL SERVER.

I suspect that there is an error in the validation for the German date format.

All the best,
Markus


multi row footer

$
0
0

Hi,

I am new to datatables. I have a multi row footer. I need to assign values outside ajax call. I used the below code for single row.
table.columns(1).footer().to$().text('TOTAL');
How can I assign values for multi row.

record not deleted from db

$
0
0

Hello,

I have an editor setup with 2 leftjoins. Everything is working fine except when I delete a record from the table it is not deleted from the db. On the screen the record is deleted from the table but after a refresh of the page the record is still there.
When I check the POST the record is stated which has to be deleted:

action remove
data[row_20][DT_RowId] row_20
data[row_20][todos][register][active] 1
data[row_20][todos][register][clid] 224
data[row_20][todos][register][datum]
data[row_20][todos][register][datumstart] 2018-01-03+16:31:22
data[row_20][todos][register][ip]
data[row_20][todos][register][mac] test
data[row_20][todos][register][type] 4
data[row_20][todos][register][url] test
data[row_20][todos][types][omschrijving] Server
data[row_20][todos][user][naam] Alphega+Apotheek+Bergense

The RESPONSE tab is showing empty:
{"data":[],"debugSql":[]}

What is going on?

Possible bug combining rowReorder and rowGroup

$
0
0

When combining rowReorder and rowGroup when dragging an element up to the stop of the table it ends up above the top row, which is pretty weird. This seems lik a bug?

Drag a row to the top of the table.
https://jsfiddle.net/6tnn7j24/1/

Write Table Column value from Textfield ?

$
0
0

Hello, is there any way to write Table Column Value from extern Textfield ? I have used multi row edit but with 3000 row table is not easy delete all rows in the same column or write all rows in this column with the same value ?

Regards
Michael

Editor dealing with a jSON field that is a sum of two table Fields

$
0
0

Okay, so I'm planning to add the php editor library to my editors instance. The table I want to be able to modify receives an ajax call that contains some JSON fields that are basically sums of two database fields. Can editor handle that?

OR over multiple columns

$
0
0

I am trying to achieve 'OR over multiple columns'. I have Firstname, Lastname and phone columns. I want to do a search filter like this ;
(Firstname AND Lastname ) OR (phone)
The default search does (Firstname AND LAstname AND phone) .
Not sure how i can do this with custom filters. Can anyone help me with this ?

DataTables presenting with a card view

$
0
0

I have seen lots of discussion on trying to get datatables to present in a "card" or "panel" type view. I see there are lots of workarounds utilizing the various callbacks and events. I believe i have found the simplest method yet.

My method relies solely on CSS. Heres a few screen shots and a link to a sample page.
azguys.com/datatables/index.html

I have tested it out on Chrome and IE, they both seem agreeable to the CSS, no funny quirks. Give it a try and let me know what you think, and if it may have problems of other browsers.


Display images using relative path in serverside datatable

DataTables w/ MS SQL Server 2014

$
0
0

I'm trying to utilize DataTables with Server Side Processing, and all of the documentation I find refers to ssp.class.php for MySQL and doesn't use the sqlsrv PHP drivers. Does DataTables support AJAX requests to MS SQL 2014 now? If so, where can I find the documentation and necessary class files?

Thank you for your assistance in advance.

Editor Instance sql SUM function addition

$
0
0

is it possible using the an Editor field instance to add several sums and use that as a field, provided you set it to false? Specifcally can I add the sums of several database fields together and use the total as a field. I know we can use 1 mysql function, does editor support something like SUM(field)+SUM(field2) ?

reordering columns breaks keyboard based sorting

$
0
0

Demo: https://datatables.net/extensions/colreorder/examples/initialisation/simple.html

Instructions: First, confirm that keyboard based sorting is working. Tab to a column header and hit enter, it should sort ascending, hit enter again, it sorts descending. Now, reorder any column by dragging it to a new position. Tab back to a column header and hit enter. The column sorts either ascending or descending (whatever it was last sorted by). Hit enter again, the sort direction does not change.

Any workaround for this?

Edited to add: tested this in Chrome, Firefox, and Edge and they all have the same problem. No errors in javascript console.

How to display a warning if a filter (search) is applied by Yadcf?

$
0
0

Hi,

All my Yadcf filters are in a collapsable box.
When the box is collapsed we don't see if there are filters set.
So I'm looking for a way to display a warning on the page if any filters is applied by Yadcf.

The only way I see is to get info from localstorage but this is complicated to parse...

Any other way to do it?

Thanks

too SLOW issue

$
0
0

I got a 10M entries table. Even with Server-side processing. It takes more than 30 seconds to show the Next page (10 entries). Any ideal why? any solutions?

Filter footer vanishes on adding sticky header with scroll

$
0
0

Here is my code - https://jsfiddle.net/w6vytssh/2/
My table

The first image shows the footer(containing the filter option for each column) in the empty table.
But when I get the data the footer is missing and is replaced by the header at the bottom. (pic 2)

I used "scrollY": 400,
"scrollX": true,
"bScrollCollapse" : true,
to make the header sticky and scrollable but that leads to the actual footer being hidden and replaced by the sticky footer(a copy of the header)
Please note that the jsfiddle link would not render everything properly since some resources are missing.
How can I fix this?


Single Save for multiple rows

$
0
0

Currently I have a save button for each row of the Datatable but I want to add the feature where any number of rows can be selected and saved on a single click of a Save button.
Here is my code - https://jsfiddle.net/w6vytssh/2/
Right now I have multiselect enabled using var table = $('#orderTable').DataTable( {
select: {
style: 'multi'
},
But I'm really confused about enabling single save.
I used the below mentioned method earlier to enable multiselect and save but it did not work and threw this error I get this error - (index):531 Uncaught TypeError: row[18].find is not a function -

I use this code to enable multi-row select -

$('#orderTable tbody').on( 'click', 'tr', function () {
            $(this).toggleClass('selected');
            var pos = table.row(this).index();
            var row = table.row(pos).data();
            console.log(row);
        } );

And this to loop over the array of selected rows and perform certain operations.

$(document).on('click','#btnAll', function(){

            var oAll =[];
            $('#orderTable tbody tr.selected').each(function(){
                var pos = table.row(this).index();
                var row = table.row(pos).data();
                oAll.push(row);


var rejectReasons = { PersistRejectReasons :[] }
    var jsonReturnObj = new Object();

jsonReturnObj.OrderNumber = row[0];
jsonReturnObj.OrderLineNumber = row[1];
 jsonReturnObj.RejectReasonCode
    =row[18].find(“option:selected”).prop(“value”);

-------------------------(Code continues)

How can I achieve this?

Post data from client side to server side to where clause

$
0
0

Hello All,
I am new to php so i m stuck can someone help me i want to send data from client side to server side .Basicaly i want to search from database and a make query like this 'Select * from inward where date >= '01/12/2017' and Date <= '01/04/2018' ' like it show in the picture but i didnt findany examples that can tell to how to do this on the client side and server side and getting data from date picker to functions to search etc
i will be glad if some one can help me with the code
p.s this site is really awsome

Is there local editing for serverside datatables?

$
0
0

I would like to do local editing in editor, but every time I edit something there is an ajax call after the draw; my table is set to serverside:true.

Common sense would tell me that serverside datatables need to render serverdata after changes but then again maybe local edits would apply to the current page.

I need operators to edit rows in a 9 thousand record table. They are doing inline edits on each row. It takes too long to wait for the ajax call per inline edit so I would like to send changes to the server with a button to the right of the column or if possible, draw the change in the local table immediately regardless of ajax response.

withSelect Option under DTOptionBuilder not working

$
0
0

I am struggling in implementing the code used in the following code.

http://l-lin.github.io/angular-datatables/archives/#!/withSelect

when I try to include following piece of code under my DTOptionBuilder I am getting an error **withSelect ** property saying that it is not an Option

.withSelect({
            style:    'os',
            selector: 'td:first-child'
        });

What I am trying to achieve is an angular datatable with checkboxes which enables user to select single or multiple rows by checking checkboxes

Thanks

withSelect Option under DTOptionBuilder not working

$
0
0

I am struggling in implementing the code used in the following code.

http://l-lin.github.io/angular-datatables/archives/#!/withSelect

when I try to include following piece of code under my DTOptionBuilder I am getting an error **withSelect ** property saying that it is not an Option

.withSelect({
            style:    'os',
            selector: 'td:first-child'
        });

What I am trying to achieve is an angular datatable with checkboxes which enables user to select single or multiple rows by checking checkboxes
There is precursor tho this question which led me to ask this question. Please take a look at the following link
https://datatables.net/forums/discussion/46616/checkbox-with-datatable-row-selection?new=1

Thanks

Viewing all 81675 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>