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

Jquery parseXML

$
0
0

Hi!

I tried to use the slim versoin of Jquery, and Datatable breaked when using "Excel" export button.
Thats because Datatable relies on the Jquery .parseXML function
Is it possible to use the stardand javascript .parseXML?
So we can decrease dependence on Jquery and use the Slim version.

Thanks a lot!
Rodrigo.


Datatable rowdetail td addclass add

$
0
0

in datatable to assign class to the td (row) we want createdRow We are using , but I can't reach the detail td , detail td the s eq() how to get there?

"createdRow": function ( row, data, index ) {

$('td', row).eq(2).addClass('green');
}

detailed examination

https://codepen.io/BesiktaS_JK/pen/JjddXbW

I want to create this:

try, but it didn't happen

'createdRow': function(row, data, dataIndex){

var match_result = data["match_result"];

if(match_result=="2-2"){$('td', row).eq(5).css('background-color', 'Orange');}

},

Datatable not showing header after displaying a hide table

$
0
0

Hello,

I have a table in my html page:

<

table id="mainTable" class="table table-striped center" style="display:none"> when the table is loaded I show them with:

fnInitComplete: function () {
$('#mainTable').show();
}

But header is not visible, i cheked the html and it generate another table without id that constains the style="display:none" for the header.

Customize DataLayout for Printing

$
0
0

First time using DataTables it's been pretty easy setting it up but I did require a bit of customization and I'm not sure if there's a way to do it. Hoping someone here can point me in the right direction.

I need to customize the print layout. Basically I have a column that contains a lot of data, it is essentially holding comments from users which could be several hundred characters long. I would like to move this piece of data in the print screen to some sort of text field below the rest of the data where it can span across the entire width of the document instead of being restricted to an actual table layout.

I'm not sure if this is possible, but If anyone can point me in the right direction it would be greatly appreciated

Don't work/ When I try open AdminVeiwDefinition doc. Help me please

$
0
0

Error 500
HTTP Web Server: Command Not Handled Exception.

xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="Log_Viewer.xml"?>
<CommonBaseEvents>
<CommonBaseEvent creationTime="2020-01-24T02:29:52.514+06:00" globalInstanceId="ELc0a8990100016fd418cc0500000000" msg="CLFRU0029W: Your data is not currently roaming because you started the session with a different application than the Notes client (for example, Symphony or Designer)." severity="30" version="1.0.1">
<extendedDataElements name="CommonBaseEventLogRecord:level" type="noValue">
<children name="CommonBaseEventLogRecord:name" type="string">
<values>WARNING</values>
</children>
</extendedDataElements>
<extendedDataElements name="CommonBaseEventLogRecord:sourceClassName" type="string">
<values>com.ibm.notes.roaming.provider.operations.NotesRoamingVeto</values>
</extendedDataElements>
<extendedDataElements name="CommonBaseEventLogRecord:sourceMethodName" type="string">
<values>shouldRoam</values>
</extendedDataElements>
<sourceComponentId component="Expeditor 6.2" componentIdType="ProductName" instanceId="1579774186232" location="RealSoft" locationType="Hostname" subComponent="com.ibm.notes.roaming.provider.notesadapter" threadId="34" componentType="http://www.w3.org/2001/XMLSchema-instance"/>
<situation categoryName="ReportSituation">
<situationType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ReportSituation" reasoningScope="INTERNAL" reportCategory="LOG"/>
</situation>
</CommonBaseEvent>
<CommonBaseEvent creationTime="2020-01-24T02:29:56.725+06:00" globalInstanceId="ELc0a8990100016fd418cc0500000002" msg="CWPMS0008I: com.ibm.collaboration.realtime.policy.sametime.managedsettings.ManagedSettingsPolicyProvider is not currently available." severity="30" version="1.0.1">
<extendedDataElements name="CommonBaseEventLogRecord:level" type="noValue">
<children name="CommonBaseEventLogRecord:name" type="string">
<values>WARNING</values>
</children>
</extendedDataElements>
<extendedDataElements name="CommonBaseEventLogRecord:sourceClassName" type="string">
<values>com.ibm.rcp.managedsettings.internal.UpdateJob</values>
</extendedDataElements>
<extendedDataElements name="CommonBaseEventLogRecord:sourceMethodName" type="string">
<values>getProvidersToUpdate</values>
</extendedDataElements>
<sourceComponentId component="Expeditor 6.2" componentIdType="ProductName" instanceId="1579774186232" location="RealSoft" locationType="Hostname" subComponent="com.ibm.rcp.managedsettings" threadId="70" componentType="http://www.w3.org/2001/XMLSchema-instance"/>
<situation categoryName="ReportSituation">
<situationType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ReportSituation" reasoningScope="INTERNAL" reportCategory="LOG"/>
</situation>
</CommonBaseEvent>
<CommonBaseEvent creationTime="2020-01-24T02:29:57.838+06:00" globalInstanceId="ELc0a8990100016fd418cc0500000004" msg="CWPCA8009W: Could not contribute catalog to launcher; contribution manager not available" severity="30" version="1.0.1">
<extendedDataElements name="CommonBaseEventLogRecord:level" type="noValue">
<children name="CommonBaseEventLogRecord:name" type="string">
<values>WARNING</values>
</children>
</extendedDataElements>
<extendedDataElements name="CommonBaseEventLogRecord:sourceClassName" type="string">
<values>com.ibm.rcp.portal.app.ui.internal.PortalCaiUIPlugin</values>
</extendedDataElements>
<extendedDataElements name="CommonBaseEventLogRecord:sourceMethodName" type="string">
<values>addCatalogToLauncherConditional</values>
</extendedDataElements>
<sourceComponentId component="Expeditor 6.2" componentIdType="ProductName" instanceId="1579774186232" location="RealSoft" locationType="Hostname" subComponent="com.ibm.rcp.portal.app.ui" threadId="1" componentType="http://www.w3.org/2001/XMLSchema-instance"/>
<situation categoryName="ReportSituation">
<situationType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ReportSituation" reasoningScope="INTERNAL" reportCategory="LOG"/>
</situation>
</CommonBaseEvent>
<CommonBaseEvent creationTime="2020-01-24T04:16:13.168+06:00" globalInstanceId="ELc0a8990100016fd418cc050000000a" msg="CLFAD0211E: Exception thrown" severity="50" version="1.0.1">
<extendedDataElements name="CommonBaseEventLogRecord:level" type="noValue">
<children name="CommonBaseEventLogRecord:name" type="string">
<values>SEVERE</values>
</children>
</extendedDataElements>
<extendedDataElements name="CommonBaseEventLogRecord:sourceClassName" type="string">
<values>com.ibm.designer.runtime.domino.adapter.LCDEnvironment</values>
</extendedDataElements>
<extendedDataElements name="CommonBaseEventLogRecord:sourceMethodName" type="string">
<values>doService</values>
</extendedDataElements>
<extendedDataElements name="CommonBaseEventLogRecord:Exception" type="string">
<values>Context Path: /xsp/127.0.0.1!!FlexViewControl.nsf Page Name: /adminViewDefinitionDoc.xsp Control id: selectItems8 Script interpreter error, line=59, col=54: 'v' is undefined at [/ssjsCCRestView.jss].<anonymous>() 57: getServers : function() { 58: var v = @DbLookup(@DbName(),"vwConfig","config","servers"); -> 59: v = (typeof v) == "string" ? [v] : v.toArray(); 60: var sList = ["current server|currentserver"]; 61: for (var x=0;x<v.length;x++) { com.ibm.xsp.exception.EvaluationExceptionEx: Error while executing JavaScript computed expression at com.ibm.xsp.binding.javascript.JavaScriptValueBinding.getValue(Unknown Source) at javax.faces.component.UISelectItems.getValue(Unknown Source) at com.ibm.xsp.component.UISelectItemsEx.getValue(Unknown Sour</values>
<values>ce) at com.sun.faces.util.Util.getSelectItems(Unknown Source) at com.sun.faces.renderkit.html_basic.MenuRenderer.getOptionNumber(Unknown Source) at com.sun.faces.renderkit.html_basic.MenuRenderer.renderSelect(Unknown Source) at com.sun.faces.renderkit.html_basic.MenuRenderer.encodeEnd(Unknown Source) at com.ibm.xsp.renderkit.html_basic.MenuRenderer.encodeEnd(Unknown Source) at com.ibm.xsp.renderkit.ReadOnlyAdapterRenderer.encodeEnd(Unknown Source) at javax.faces.component.UIComponentBase.encodeEnd(Unknown Source) at com.ibm.xsp.component.UISelectOneEx.encodeEnd(Unknown Source) at com.ibm.xsp.util.FacesUtil.renderComponent(Unknown Source) at com.ibm.xsp.util.FacesUtil.renderChildren(Unknown Source) at com.ibm.xsp.renderkit.html_extended.HtmlBasicRenderer.encodeChildren(Unknown Source) at com.ibm.xsp.renderkit.ReadOnlyAdapterRenderer.encodeChildre</values>
<values>n(Unknown Source) at javax.faces.component.UIComponentBase.encodeChildren(Unknown Source) at com.ibm.xsp.util.FacesUtil.renderComponent(Unknown Source) at com.ibm.xsp.util.FacesUtil.renderChildren(Unknown Source) at com.ibm.xsp.renderkit.html_extended.HtmlBasicRenderer.encodeChildren(Unknown Source) at com.ibm.xsp.renderkit.ReadOnlyAdapterRenderer.encodeChildren(Unknown Source) at javax.faces.component.UIComponentBase.encodeChildren(Unknown Source) at com.ibm.xsp.util.FacesUtil.renderComponent(Unknown Source) at com.ibm.xsp.util.FacesUtil.renderChildren(Unknown Source) at com.ibm.xsp.renderkit.html_extended.HtmlBasicRenderer.encodeChildren(Unknown Source) at com.ibm.xsp.renderkit.ReadOnlyAdapterRenderer.encodeChildren(Unknown Source) at javax.faces.component.UIComponentBase.encodeChildren(Unknown Source) at com.ibm.xsp.util.FacesUtil.renderCompo</values>
<values>nent(Unknown Source) at com.ibm.xsp.util.FacesUtil.renderComponent(Unknown Source) at com.ibm.xsp.util.FacesUtil.renderComponent(Unknown Source) at com.ibm.xsp.util.FacesUtil.renderComponent(Unknown Source) at com.ibm.xsp.util.FacesUtil.renderComponent(Unknown Source) at com.ibm.xsp.component.UIViewRootEx._renderView(Unknown Source) at com.ibm.xsp.component.UIViewRootEx.renderView(Unknown Source) at com.ibm.xsp.application.ViewHandlerExImpl.doRender(Unknown Source) at com.ibm.xsp.application.ViewHandlerExImpl._renderView(Unknown Source) at com.ibm.xsp.application.ViewHandlerExImpl.renderView(Unknown Source) at com.sun.faces.lifecycle.RenderResponsePhase.execute(Unknown Source) at com.sun.faces.lifecycle.LifecycleImpl.phase(Unknown Source) at com.sun.faces.lifecycle.LifecycleImpl.render(Unknown Source) at com.ibm.xsp.controller.Face</values>
<values>sControllerImpl.render(Unknown Source) at >

calling sp in controller

$
0
0

This not so much a datatables question other than it is in a asp.net mvc project that has datatables in it. I am having the user import a text file into a datatable: https://editor.datatables.net/examples/extensions/import

After it is imported and they have reviewed the data, I need the user to click a button to call a stored procedure. The stored procedure is parsing the data and putting into another table, which is the datasource for another datatable. But the stored procedure itself does not return any data. From what I am researching, since datatables uses MVC i need to put that call in a controller.

    public class ParseImportDataController: ApiController
    {
        [HttpGet]
        [HttpPost]
        public IHttpActionResult cleanAndImport()
        {
            var request = HttpContext.Current.Request;
            var settings = Properties.Settings.Default;
            string AsOfCookie = request.Cookies.Get("AsOfDate").Value;

            string strCon = settings.DbConnection;
            SqlConnection DbConnection = new SqlConnection(strCon);
            DbConnection.Open();

            SqlCommand command = new SqlCommand("sp_ImportFTE", DbConnection);
            command.CommandType = System.Data.CommandType.StoredProcedure;
            command.Parameters.Add(new SqlParameter("@EffectiveDate", AsOfCookie));
            command.ExecuteNonQuery();
            DbConnection.Close();
            return Ok(1); //no idea what to return
        }
    }

I can't find out how I have the button click call this code in the controller. Any help would be greatly appreciated.

I have no idea if the code in the controller is correct, but I figure that will be the next struggle.

Responsive: Child row not updated with row

$
0
0

I have this code updating a single row when receiving an event from server:

var rowId = $('#episodes').DataTable().row('#row_' + event_json.episode);
if (rowId.length) {
    $.ajax({
        url: "{{ url_for('api.episodes') }}?seriesid=" + event_json.series + "&episodeid=" + event_json.episode,
        success: function (data) {
            if (data.data.length) {
                $('#episodes').DataTable().row(rowId).data(data.data[0]);
            }
        }
    })
}

It works perfectly well when responsiveness isn't required but as soon as a child row is created in responsive mode, this child row isn't updated at the same time as the row.

Is there something I can do to get it updated at the same time?

Thanks!

I want to edit a column value for multiple rows using datatables.

$
0
0

I've rendered the checkbox using render function like this
render: function(data){ var html = ''; if(options.check) html = '<input type="checkbox" class="cx-action ' + options.checkClass + '" data-id="' + data +'">\n'; return html; }
Don't know what to do next to update the records.

Pardon any mistakes. I'm new here.

Thanks


layout: 'columns-6',

$
0
0

aumentar este numero ya que requiero 8 columnas

Sorting RowGroup on group values

$
0
0

I am fairly new to datatables but have found it to be awesome. I stumbled across the RowGroup functionality and it is great. I ultimately want to sort by the number of elements in each group but was playing around with different functionality and unable to get it to do what I want and looking for a little help. I tried to follow the example that was posted here but could use a little help. First of all I tried to strip it down to the basics so I got rid of collapsing stuff and a little more. My table is a list of pro tennis players that played in college. I have a regular table that just lists them in order (found on my website here) and I am creating another version grouped by college so you can see how many from each college are in the Top 1000 pros. The live test case for my attempt that is failing to group by college with sorting is located here (I sure hope that link persists as this is my first attempt using live.datatables.net). I would like to do 2 things:

  1. Be able to sort the table by number of players per college. I'd honestly be ok if the user could sort nothing after that and maybe just add collapsing to it.
  2. Just because I saw the example of sorting on grouped totals I wanted to learn and get it to work but it is not working. You will notice that I attempted to add a total Points per college but it is only showing the first row, not the total for the group. I'd like the group row to show the total for the group and then when you click on the Points header have it sort on Group Points not the individual rows.

There are a few things I don't understand that would be great if someone could explain as well.

  1. What does the statement pointTotal = $.fn.dataTable.render.number( ',', '.', 0).display( pointTotal ); do? I feel like it must be saying that you take pointTotal and make it an object whose value is still the number represented by pointTotal but whose display characteristic is the format as indicated. Is that correct? I saw the docs for render.number but not for .display so not really sure what that does. I'd love to hear an explanation of that whole statement broken down to get a clear understanding.
  2. As long as I have orderFixed in my options I don't think I can sort like I want on points, but when I take it out things go haywire and I have no idea why. Keep clicking Points and it does all kinds of weird stuff.

Any help greatly appreciated.

Serverside Column control - right

How to get Events occurring after file export.

$
0
0

Hi everyone.

I applied the Datable Plugin when receive the excel file because there ware some problems with the existing excel export method.

All the pages could not be changed, so i tried to make a pop-up form and apply Datatable Plugin and call this on each page.

Successfully drawing tables and buttons in pop-up windows and using a table.buttons().trigger() to automatically select the export button on screen calls and The Excel file was successfully received, but a pop-up window remains.

So I tried to close it automatically after receiving it, but it didn't work.

How do I get events after 'Save As'?

Datatables what is the best approach?

$
0
0

I am new to Datatables/js etc and have no training in this. It's a hobby. So far, I have 2 HTML pages that calls 1 main.js file from which I can call the functions to produce 2 tables from 2 API's as offered. What I want to do, is combine parts of one api with another to produce the table layout I want. I have found out that if you load onr table then switch HTML pages, the main.js is read from the start so you lose the content of global variables. I have tried to get round this by using this code provided by Allan on another thread

var data = [];
 
table.rows().every( function () {
  data.push( table.cells( this, [ 0, 1, 2 ] ).data().toArray() );
} );

but that does not seem to store the array in a format that can be accessed ( no [] or {} bits, probably the way I am using it)
I have also tried HTML localStore, sessionStore, but again I can't access the data although I can see it in console.log.
The best I have managed so far is to get an entire array into one column rather than just the one item.
I am thinking maybe I should split up the main.js file for use by each HTML page? Later, I may add more pages so before going down this route I thought I would ask what 'best practice' is from a datatables perspective to combine and access multiple api's on one HTML page and if there is an example that can be pointed to.

Thank you.

Function to exclude columns from print

$
0
0

The client wants printed output that only includes the currently visible columns, which I can do with ':visible'. However they also want to exclude certain columns, irrespective of their visibility. So I need a way to exclude the columns they don't want, whilst selecting visible columns that aren't in the exclude list.

I think the only way I can do this is with a function as a column-selector. However I can't get it to work, just testing with the following:

                    {
                        extend: "print",
                        text: "Print - Results",
                        exportOptions: {
                            function(idx, data, node) {
                                return false;
                            }
                        }
                    }

As far as I can tell, the function doesn't execute when I click the print button, and all columns appear in the output.

I've tried to do a test case of this but I get a script error when I include the buttons plugin:

http://live.datatables.net/lekoduwu/1/edit?html,js,console,output

Can you either tell me what I'm doing wrong in the demo, or let me know if what I'm trying to do with the Print button is possible?

Cheers.

How to Fix Server Side Processing with JOIN query

$
0
0

Hi Everyone, Good day.
I've been looking for a solution for about 3 days but still can't find any help.
here is the screenshots of datatables error

i edited my ssp class and add some customize function found online to enable JOIN query
but unfortunately i doesn't work perfectly now. It always shows alert error about 30 seconds execution from the server.

I hope someone can help me debug since i'm new with this.


Set row height then paging failed?

$
0
0

As title. I want to make my table show 10 rows each page, and heights of each row are same.

var dt=$("#tblData").DataTable({
    scrollY : "calc(100% - 100px)"
    ,scroller:{
        rowHeight:55;
    }
    ,paging: true
});

I had 14 rows to show,and if I set my DataTable as above,all of them have same row height, but all of them shown inside a page. But if I use the settings below, I can see my result into 2 pages but 4 rows in 2nd page has more row height.

var dt=$("#tblData").DataTable({
    scrollY : "calc(100% - 100px)"
    ,paging: true
});

How could I have paging effect and make same row heights for each row?

Grab click event of a checkbox added with prepend

$
0
0

Hi

I have added a checkbox with the prepend method to an editir form. what is the correct syntax for grabing the click event. Tried these but they won't work:

         $('input:checkbox').on('click', function () {
             alert('aaa');
         });

        $("#chkDoNotInsertDistributorPOSCommission").click(function () {
             alert('aaa');
        })

I tried looking on the forum but couldn't find anything. Thanks.

Escaped mysql function in join condition

$
0
0

Hi there!

I'm trying to use a BETWEEN condition when joining a table using
->leftJoin( 'ageclass', ' YEAR(user.birthdate) BETWEEN ageclass.startYear AND ageclass.endYear ', '', '')
but my YEAR-functions ends up in
ON `YEAR`(user.birthdate) BETWEEN ageclass.startYear AND ageclass.endYear

Any ideas how I can avoid the escaping of the YEAR-function or any better solution for my BETWEEN condition?

Thank you!

Display a column instead of a row

$
0
0

Hi,

I am searching this for a long time and I found nothing.

I would like to display a column instead of a row after searching for something.

For example, when i search 'Satou' here , i would like to see all the column Name because Airi Satou belong to the column Name ( instead of seeing the row for the Name/ Position/Office/etc. )

I'm really stuck, i really appreciate some helps, thank you :)

Multiply values and apply style in Datatables

$
0
0

Dear community,
I would like to understand how to multiply column values and apply style in Datatables.

Currently my columns section looks like this :

"columns": [
{ data: "id" },
{ data: "brand" },
{ data: "description" },
{ data: "nb_ref" },
{ sortable : false, data: "cost", render: $.fn.dataTable.render.number( ' ', '.', 2, '€' ) },
]

what I would like in the 5th column is to multiply the "cost" by the "nb_ref" (the value of the 4th column) and still apply the number format.

Any idea about how to achieve ?

thanks

Adam

Viewing all 81697 articles
Browse latest View live


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