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

Copy extension to copy on a particular column using name

$
0
0

I have a dynamically generated table on the server with varying column numbers and names. I want to provide user an option to copy a particular column by name (which is always present). Somehow it is not working. It comes back with 0 records exported.

I have posted an example at http://live.datatables.net/rumewuko/1/edit

The relevant javascript portion is below. I am suspecting that my columns syntax is not write but can't say for sure?

<script type="text/javascript" charset="utf-8">
            $(document).ready(function() {
    $('#example').DataTable( {
        dom: 'Bfrtip',
        buttons: [
                        { extend: 'copy', className: 'btn btn-primary' },
                        { extend: 'csv', className: 'btn btn-primary' },
                        { extend: 'excel', className: 'btn btn-primary' },
                        {
                            extend: 'copy',
                            text: 'Copy Office',
                            className: 'btn btn-primary',
                            header: false,
                            exportOptions: {
                             columns: ['Office:name']
                            }
                        }
                 ]
    } );
} );
        </script>

Also is it possible to add some space between the buttons? Even though I have overwritten the style it seems to carry the default style and does not leave any space between buttons.


Calculate age when date of birth is filled out

$
0
0

Hi,

is it possible to calculate the age immediately after the field "date of birth" is filled out and show the result right to the field?

With options “message” or “fieldInfo” it possible to add texts left or below the field.

How is possible to put them right to the field and how could it calculate the age?

Thanks for any support.

Patrick

Cannot reinitialise datatable

$
0
0

Hi,

I have a function defined like below and I am trying to use the same function in another jsp file to make the modal stay in same page. But, I get the error. I am just calling the same function without declaring jQuery('#automap_err').DataTable() anywhere in the jsp again as it is already defined in the function in another js file. Please help

DataTables warning: table id=automap_err - Cannot reinitialise DataTable. For more information about this error, please see http://datatables.net/tn/3

function refreshTable()
{
try{
var _t = jQuery('#automap_err').DataTable();
_t.draw(false);
}catch(e){}
}

Send PDF exported by DataTables to PHP as Base64

$
0
0

First of all great Plugin works wonders, but I have a scenario where, when a user would want to email the PDF generated by DatataTables to other users. The first idea that came to my mind was to convert this PDF to Base64 then send it to server side, lets say PHP. But how would one go around. I think it is an important feature.

Parent / child editing with Editor doesn't store parent id

$
0
0

Hello,

I used this example https://datatables.net/blog/2016-03-25 and when I create a new child entry the new chield entry doesn' store the parent id. This makes the link between parent and child entry impossible.

Is it a common bug or did I something wrong? Should I post my complete source code?

Kind regards

Patrick

How to open a form on the web page without pop-up window?

$
0
0

How to open a form on the web page?
Without pop-up window.

search in multiple columns

$
0
0

Hi,
It seems than I cannot find how to use the table.columns([0, 1, 2, 3]).search().draw() method properly...
When I tried it, it doesn't gave me the result I expected...

My simplified JS code look like this:

var table = $('#list').DataTable();
$("#list_filter input").on('keyup click', function() {
    table.columns([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]).search($(this).val()).draw();
});

$("#number_search").on('keyup click', function() {
    table.column(10).search($(this).val()).draw();
});

All the searchable are true and columns 9 and 10 are .hidden (display: none !important;).
My purpose here is to use the "usual" search field to search in the 10 1st column and the last one with an extra text field...

Does this search method searches on column 0 AND column 1 AND column 2 AND ... in spite of what I am expecting with OR ??

Thanks for any help!

Using Buttons plug-in to export table with dynamically added data?

$
0
0

Ahoy! I'm using DataTables with the Buttons extension with the hope of being able to easily copy-to-spreadsheet the contents of my table. However, it's a table that the user modifies on the fly, with contenteditable cells.
Is it possible for exportData() to get the most recent data? (I saw an old post that seemed to say no, but I want to double check, since it seems like an oft-desired use case).

Thank you!


Editor Custom Form

$
0
0

Hi,
I am using the editor with a custom form and it works great. The custom form is generated through the use of a Jade like template compiler (vibe.d -- diet templates). This allows me to embed 'D' code in the template so at load time I can alter the output HTML.
The following is the definition in the template language.

    div#customForm
      fieldset.name
        legend Path To Device
        editor-field(name='depotName')
        editor-field(name='clientName')
        editor-field(name='rtuName')
      fieldset.name
        legend device
        editor-field(name='deviceName')
        editor-field(name='serialNumber')
        editor-field(name='assetNumber')
        editor-field(name='location')
        editor-field(name='ipAddress')
        editor-field(name='deviceType')
        editor-field(name='deviceStatusMessage')
        - if (!anySet(perms[Permissions.printerQuiesce..Permissions.printerQuiesce+1]))
          editor-field(name='quiesce')
        - if (!anySet(perms[Permissions.printerManualDataUpdate..Permissions.printerManualDataUpdate+1]))
          editor-field(name='serviceTag')
          editor-field(name='eventId')
      fieldset.editable
        legend User Configurable Fields
        - if (anySet(perms[Permissions.printerQuiesce..Permissions.printerQuiesce+1]))
          editor-field(name='quiesce')
        - if (anySet(perms[Permissions.printerManualDataUpdate..Permissions.printerManualDataUpdate+1]))
          editor-field(name='serviceTag')
          editor-field(name='eventId')

The '- if' statements are executed at load time and basically they are checking a bit map of user permissions for the current session user and will cause the appropriate HTML to be generated. Based on the user permissions I alter the location of the fields on the form.
What I would also like to do is not allow input for the quiesce, serviceTag, and eventFilter fields unless they are generated under the User Configurable Fields section of the form. Can I add some tag to the editor-field (like readonly) to achieve this without resorting to javascript after the load. I would rather not have anything to do with the permissioning show up in the loaded page.

I appreciate any assistance you may be able to provide.

Duplicate click without must to selected

$
0
0

If it can be done as follows:

               $('a.editor_create').on('click', function (e) {
                    e.preventDefault();
                    editor.create({
                        title: 'CREATE NEW ROW',
                        buttons: 'CREATE',
                        onEsc: 'blur'
                    });
                });

                $('#example').on('click', 'a.editor_duplicate', function (e) {
                    e.preventDefault();
                    var values = editor.edit(table.row({
                        selected: true}).index(), false).val();
                    editor.create({
                        title: 'DUPLICATE THIS ROW',
                        buttons: 'DUPLICATE',}).set(values);
                });

                $('#example').on('click', 'a.editor_edit', function (e) {
                    e.preventDefault();
                    editor.edit(
                        $(this).closest('tr'),{
                            title: 'EDIT THIS ROW',
                            buttons: 'UPDATE',
                            onEsc: 'blur'
                        });
                });

                $('#example').on('click', 'a.editor_remove', function (e) {
                    e.preventDefault();
                    editor.remove(
                        $(this).closest('tr'),{
                            title: 'DELETE THIS ROW',
                            message: 'Want to delete?',
                            buttons: 'DELETE'
                        });
                });

when I click on the create, update, delete, duplicate.

Click the row without the required selection (selected) - click creation without necessarily choosing works without a problem, then work to update and removal.

The problem is that without duplicating the selection does not work.

I want so I clicked without necessarily duplicating row selection, is it possible?

Button click to change value

$
0
0

I ask you and please you for help me for small source code for - button click to change value:

  1. example - this is working
$('a.editor_create').on('click', function (e) {
                    e.preventDefault();
                    editor.create({
                        title: 'NEW ROW',
                        buttons: 'CREATE',
                        onEsc: 'blur'
                    });
                });
  1. example:

https://editor.datatables.net/examples/api/triggerButton.html - for add cost price.

I want to source code for I click to CHANGE, then field will changed to value in string - 'YES'.

Thank you.

editor fields: how to add "select2" to a field if another field value has a certain value?

$
0
0

Is it possible to conditionally change the input form type in editor?
I have a table with a list of transports associated to an order. Loading and unloading destination can be any string but if the transport type is a ship then only pre-loaded list of ports should me allowed.
That is required for statistics purpose where a misspelling of the port name can ruin the results.

Code is like bellow:

$(document).ready(function() {
    var editor = new $.fn.dataTable.Editor( {
        ajax: 'php/pageOrderTabTransport.php?id_order=' + id_order ,
        table: '#tabel_transport',
        fields: [
            {
                label: "Type:",
                name: "otc_transport.id_tip",
                type: "radio",
                ipOpts: [
                    {label: '<i class="fa fa-ship fa-2x color-1 space-bottom-1"></i> Ship', value: '1'},
                    {label: '<i class="fa fa-plane fa-2x color-2 space-bottom-1"></i> Plane', value: '2'},
                    {label: '<i class="fa fa-truck fa-2x color-3 space-bottom-1"></i> Truck', value: '3'},
                    {label: '<i class="fa fa-train fa-2x space-bottom-1"></i> Train', value: '4'},
                    {label: '<i class="fa fa-cogs fa-2x color-4 space-bottom-1 "></i> Custom', value: '5'}
                ],
                default: "1"
            },
       {
        label: "Loading from:",
        name: "otc_transport.loading_city"

/////   if Type is 1 (ship) then instead of regular string to be entered, user must select2 from a list of enlisted ports.
////    so I need to add something like:
                type: "select2",
                options: ListOfPortsLoad()

            },
// more code...

Maximum multi row edit?

$
0
0

If I select any number of rows and multi edit a column
only the first 12 rows actually get updated with the edit.

Is there a hard coded limit or am I doing something wrong?

Thanks

Prevent form-inline class?

$
0
0

Is it possible to prevent form-inline class when opening an hidden row with a form inside it?

Buttons not showing up


fixed header disappears when scrolling around 200 and more entites

$
0
0

Hello!
My problem in subj. Could you help me?

Semantic UI in Generator

$
0
0

Hi. Do you have any plans on including Semantic UI as a style option in generator?
-b

FixedHeader and FixedColumns

$
0
0

Hello
how can i do combo FixedHeader thead and FixedColumns (leftcolumm:2)?
i want freeze header and 2 left columns
my setting is like this
{
fixedColumns: true,
fixedHeader: {
header: true,
footer: true
}
}
it works fine with footer but header doesn't work. Is this bug or i have add more config?

Default value not showing in editor text field

$
0
0

I have initialized an editor text field with

type:'text',
attr:{
    type:'number',
    min:0
},
def:'0'

Everything is working except the** default value** of the field (The text field remains empty at new)

I even tried extending the text field and setting val with jquery but still the same.

      _fieldTypes.number = $.extend(true, {}, _fieldTypes.text, {
            create: function (conf) {
                conf.attr = conf.attr || {};
                conf.attr.type = conf.attr.type || "number"
                // Call original create
                conf._input = $(_fieldTypes.text.create.call(this, conf));
                return conf._input;
            },
            set: function (conf, val) {
                return $(conf._input).val(val)
            },
        });

From the debugger I noticed that during set the val parameter is correct (0) but when setting the input val with jquery nothing happens when $(conf._input).val(val).

How can I enable/disable custom button in editor

Viewing all 81387 articles
Browse latest View live


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