angular-datatables

How to disable initial Ordering of data in Angular Datatables?

依然范特西╮ 提交于 2020-01-05 04:05:33
问题 I am using angular datatables and I have only one column. When I bind it, the data comes in an ascneding order, while I want to display it in the order I recived it. Can someone please help. Controller : var vm = this; vm.dtOptions = DTOptionsBuilder.newOptions() .withButtons([ 'print', 'pdfHtml5', ]); vm.dtColumnDefs = [ DTColumnDefBuilder.newColumnDef(0).notSortable() ]; HTML : <div ng-controller="formViewController as frmView"> <table datatable="ng" dt-options="frmView.dtOptions" dt-column

How to filter out the data between a start and end date using filterPredicate in Angular Material Data Table?

北城余情 提交于 2020-01-03 03:27:04
问题 In my data table I have a Start date column and an end date column. And I need to filter out the data in the table between the start and end dates. And using this post , I was able to write the filter Predicate. But it only filters the exact start date and exact end date. The API returns the date in a string format like "2018-08-30". So, how to filter out the data between the start and end dates ? 回答1: First, you need to add the Range filter, or Range must in your query to get the result set

how to customize angular-datatables' style

我们两清 提交于 2020-01-02 05:55:46
问题 I'm new to angular, trying to use angular-datatables library http://l-lin.github.io/angular-datatables/#/angularWay, but don't know how to control the style of the table, cause they are all angular directives, is it possible I can touch the HTML elements inside? like the example below, how can I remove the text next to search box? Also I've read API, couldn't find how to hide the datatables_info on the buttom. update maybe I can hide them through CSS, but seems it's impossible to add

angular-datatables the deferRender not working

别来无恙 提交于 2019-12-25 06:49:48
问题 I am using angular datatables with fnPromise and my data is about 10,000 rows also i use scrollY and i want to render only the visible rows for performence My code: vm.dtOptions = DTOptionsBuilder.fromFnPromise(function() { var defer = $q.defer(); var dataPageParams = { columnFilters: [], endIdx: -1, startIdx: -1, filterParams: parentVM.filterParams, sortDescending: false, instanceID: parseData.instanceId }; if (parentVM.filterId !== '') { dataPageParams.filterID = parentVM.filterId; }

Data table integrated with Angular not showing export buttons such as Excel, PDF

我与影子孤独终老i 提交于 2019-12-24 17:15:56
问题 "styles": [ "../node_modules/bootstrap/dist/css/bootstrap.min.css", "../node_modules/datatables.net-dt/css/jquery.dataTables.css", "../node_modules/datatables.net-buttons-dt/css/buttons.dataTables.css", "styles.css" ], "scripts": [ "../node_modules/jquery/dist/jquery.min.js", "../node_modules/popper.js/dist/umd/popper.min.js", "../node_modules/bootstrap/dist/js/bootstrap.min.js", "../node_modules/jquery/dist/jquery.js", "../node_modules/datatables.net/js/jquery.dataTables.js", "../node

angular-datatables : How to remove “Show N entries” but leave pagination

霸气de小男生 提交于 2019-12-24 15:24:15
问题 There is a project that uses angular-datatables. Now I need to remove "Show N entries" dropdown from a page with such table, but leave pagination untouched. For now i've found this way - withOption('paging', false) but this removes both! Can anyone show me better way than just to remove them from DOM manually? 回答1: Yes - paging removes both since there is no need for showing the lengthmenu if the table not is paginated. Use the lengthChange option to control whether the lengthmenu should be

How to modify the way the data table filter works in Angular Material?

淺唱寂寞╮ 提交于 2019-12-24 10:45:40
问题 I am trying to use the filter in Angular Material Data Table like - If I search for " MATCHED ", then both " MATCHED " and " UNMATCHED " comes up in the status column of the Data table. I know that it is because the data object is reduced and concatenated and the filter is applied( from the Angular Material Docs ). I want to display only the " MATCHED " status, if is search for matched. So I am looking for a filter that will do exact word filtering instead of substrings. How to proceed ? I

Refreshing datatables.net table data in Angular 7 keeps a copy of the old data from table's first loading

做~自己de王妃 提交于 2019-12-24 08:41:02
问题 I'm trying to make a live reporting from a REST API request using the datatables.net library in Angular 7. If I make a data update into the database, the data in the table is updated. However, If I touch the table (i.e. reorder, search for something, change the page, etc), on data reloading (which occurs every 5 seconds), in the table is added the data from the first load of the table. If I touch the table again, the updated data disappears, and only the old data remains, until the next data

TypeError: table.renderRows is not a function

China☆狼群 提交于 2019-12-24 08:39:59
问题 I'm using Angular material datatable with array as datasource. I would update my table every data change using renderRows() method as mentionned in the doc. I have my ts file import { Component, OnInit } from '@angular/core'; import { MatTableDataSource } from '@angular/material'; import { AjouttextService } from '../ajouttext.service'; import { DataSource } from "@angular/cdk/collections"; import { Observable } from "rxjs/Observable"; import { nomchamp } from '../model'; @Component({

Formating angular datatable before exporting to pdf

不问归期 提交于 2019-12-24 06:47:10
问题 var app = angular.module('myApp', ['datatables', 'datatables.buttons']); app.controller('MyCtrl', function($scope, DTOptionsBuilder, DTColumnBuilder, DTColumnDefBuilder) { $scope.list = [{ "eid": "10", "type": "1", "sales": "20", "status": "1" }, { "eid": "20", "type": "2", "sales": "40", "status": "0" }, { "eid": "30", "type": "1", "sales": "20", "status": "1" } ]; $scope.vm = {}; $scope.vm.dtOptions = DTOptionsBuilder.newOptions() .withOption('order', [0, 'asc']) .withButtons([ { extend: