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

using javascript hashtable as datasource

$
0
0

I have read the docs, but havnt been able to find a solution
https://datatables.net/reference/option/columns.data

i have a javascript object as a hashtable.. the data consist of
list[hashcode] = {arg : value, arg2 : value2 .... }
ie.. list is not a conventional array, but associative/hashtable like.. i dont know beforehand what hashcodes will be
how do I make datatable read from such a data structure?

-meekaaku


Individual column searching (text inputs) doesn,t work fine

$
0
0

Hi Allan
In 99% percent of my apllication it works, but I don' t know why in one option it doesn't works.
In this opion, with the data of my tables, you type 'a' in name column and if filters ok, but if you type 'q' not.
Can I give you a link in irder you see it ?
Thanks.

GroupBox

$
0
0

Is it possible to add a groupbox to new/edit windows?
If so, can you direct me to examples?

Thanks,
Karen

Helo with mJoin Link

$
0
0

The following example seems to work fine in terms of displaying everything I need, however, in the JSON I see the data for all records in the DB, not just the ones matching the Link(). As the dataset gets bigger, this function is taking forever. How can I fix this?

          ->join(
              Mjoin::inst( 'Booked_Extras' )
                  ->link( 'TripDB.TripID', 'Booked_Extras.TripID' )
                  ->fields(
                      Field::inst( 'Booked_Extras.Name' )
                          ->options( 'Booked_Extras', 'TripID', 'Name' )
                          ->set(false)
                          ->name('Name'),
                      Field::inst( 'Booked_Extras.Price' )
                          ->options( 'Booked_Extras', 'TripID', 'Price' )
                          ->set(false)
                          ->name('Price'),
                      Field::inst( 'Booked_Extras.Qty' )
                          ->options( 'Booked_Extras', 'TripID', 'Qty' )
                          ->set(false)
                          ->name('Qty')
                          )
                  ->where('TripDB.TripID', 'Booked_Extras.TripID', '=')
                )
          ->where('OrderID', '1234-5678', '=')
          ->process( $_POST )
          ->json();

I only want the Extra's for all the Trips of that one Order.

I recently added the ->where('TripDB.TripID', 'Booked_Extras.TripID', '=')
...but it didn't help.

checkboxes in datatables?

$
0
0

my customer wants a new functionality that would allow him to choose certain data rows, for instance by adding a checkbox for each line (the table would have to be placed inside a form, and there would be a submit button somewhere). I haven't tried if that works yet - can it be done? even if paging is switched on? even if the table is fed by javascript?
Or could the choosing be done in another way?

-Michael

api method to show datatables empty message

$
0
0

Is there a way to show the empty message , calling api method?

ex:

if (obj.tbl.data().count() == 0) {

                    $('#' + obj.tableId + ' .dataTables_empty').parent().show();
                    var el = $("#" + obj.tableId + "_wrapper > div:nth-child(2) > div > div > div.dataTables_scrollHead > div > table > thead > tr > th:last");
                    el.append("<button class='btn btn-xs btn-success tblCreateBut'><i class='fa fa-plus fa-xs'></i></button>");
                }

for instance, instead of" $('#' + obj.tableId + ' .dataTables_empty').parent().show(); " , use of obj.tbl.showEmptyMessage() ???

Thanks in advance

Edited by Allan - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.

columns().search() question

$
0
0

The following code will find data within both columns 0 and 2. How can I find data within either columns 0 OR 2?

oTable.columns([0,2]).search(loadSearch, true).draw();

Search Highlighting

$
0
0

Hello Allan,

I would like to add search highlighting to datatables. You've previously touched on the subject in a previous blog post -- can you clarify on who to implement the feature? Some of the files mentioned in the article seem to be out of date, is it ok to use them?
https://www.datatables.net/blog/2014-10-22


Showing all rows

$
0
0

I have a data table that has A question in the first column and answers in a second column.

If the user hits submit and their are questions check and no answers I turn the row red.

I want to take this a step farther and show only The red rows so the user can fix the issues before submitting the form.

Any ideas on how I go about this?

Thank You,

Randy

display new data

$
0
0

new data is added successfully but the grid is not getting updated with the new data .
Server response is below

draw:1
data:Object
Items:Object
Accsub:cu67
Accmast:bill

I have stated Idsrc: Accsub .Please let me know where I can make the changes ?

Loading state

$
0
0

I am trying to figure out a way of creating multiple saved report formats that can be retrieved by different users in the future.

My idea is to use current data for the report, allow the admin to modify the report (hid columns, order report, search,etc), Then press a button to save the state in the database. Another user could then come along and select that report to run.

I can figure out how to get the current state using "state()" but I can't seem to be able to find how to load a state from a json.

Search-Problems: select search-fields, priority for matching words

$
0
0

As part of a larger project I am using DT to display a list of various HTML-Examples with their descriptions. And I'd like the list to be searchable.

Now, there is a problem when users search for tags such as a/i/b as well as br/ol etc., since entering a will match nearly everything, "ol" also matchs "control", "old" etc., so a lot of irrelevant stuff is being shown.
Currently discussing two ideas with the other devs (I'm the only one with DT-experience):
1. dropdowns to select search-fields (name of control, description, everything)
2. prioritize elements that match completely over partial matches (I guess this will also require to fiddle with the sorting...)

I was surprised to see that not many search-plugins are available in general and also these two features were not addressed. So I wonder if the ideas are "too far out" or perhaps even impossible (have I overlooked anything?). Or maybe (hopyfully) they are too trivial? I'd be happy for any comments/suggestions/code you may have :-)

api draw() and clear() fails

Cannot edit more than 200 rows at the same time

$
0
0

Hi Alan,

I have a complex (at least from my point of view...) table with more than 300 rows. When I select all of them (with the button), all are selected and then if I edit one field it edits just the first 200 rows, and reloads the table with just these 200 rows.

Any ideas why this exact number? Is it some kind of datatables limit?

The only way to finish the edition is to select the other rows helped with the shift.

I have an ajax in a postedit which works well and I don't think it has anything to do with this. I cannot let you in the table because it has sensitive data.

I would appreciate any kind of help.

problem with draw

$
0
0

Cannot redefine record count on window[o].tbl.clear().draw();

If table have 3 records and i clear table with tbl.clear().draw() , number of records in datatables info dont reflect the correct number of records. It keeps the same info and should be 0.
I use server side processing.

Thanks


change zeroRecords ? message on reload

$
0
0

i have a datatable using ajax json source, with a filter parameter

by default, on page load, i want the table to be empty, so use an empty string as the parameter

on entering text in a text field and clicking a button, the text field value is passed as a parameter, and the table is reloaded.

$("#confirm").click(function(){
    emailaddress = $('#Email_Address').val();
    table.ajax.url('/ajax/invoices.php?OrderEmail='+emailaddress).load();
});

At the moment, i have a message displayed in the table on zeroRecords, so when the page is loaded, the message is displayed.

language: {
        "zeroRecords": "Confirm your email address above to display the ticket orders placed"
    },

How can i change this message on reloading the data, so that if no rows are returned, the user is given a visual clue that there are no rows, - otherwise it looks like nothing has happened

Chrome not allowing synchronous calls

$
0
0

I am using a stateLoadCallback. One of the parameters the documentation recommends is "async": false. The problem is that Chrome has deprecated that and returns the following warning;
Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check ...

The problem is that without that the stateSaveCallback triggers first and wipes out my saves state. I do not know how to fix this.

ServerSide Processing Display only specific data

$
0
0

Hello, we are using server side processing to display rows/columns from database. How we can setup on that way that it only should display data if Coumn user= 1?

Hide filtered information

$
0
0

Hello, if it is possible to hide this information: "(filtered from xxx total entries)"

Trying to dynamically add a row via javascript

$
0
0

I'm using version 1.10.2. According to the documentation, fnAddData is deprecated prior to 1.10.

What I'm doing is I'm moving a row from one table to another via a click event. The click event does an ajax call to the server to check for duplicates. Upon the ajax return, is the JavaScript to add the row in the other table. I have a global JavaScript variable which keeps the initialization of the DataTable.

According to the documentation I should be able to do ClientCurrentAlertList.row.add([a, b, c]);

However I get the following: 0x800a138f - JavaScript runtime error: Unable to get property 'add' of undefined or null reference

What am I doing wrong? I can look at ClientCurrentAlertList and access the fnAddData function.

I include Jquery-1.10.2.js, jquery.dataTables.js. Why is the "add" property undefined? This is not the first time this question has been asked. Unfortunately, the question was closed with no other explaination.

Viewing all 2364 articles
Browse latest View live