标签: ng2-smart-table

ng2智能表复选框在所有页面上都不是持久的

我是ng2-smart-tables的新手.我正在尝试从GitHub页面修改下面的示例,以便在从一个页面移动到另一个页面时复选框不会消失.

import { Component } from '@angular/core';

@Component({
  selector: 'basic-example-multi-select',
  template: `
    <ng2-smart-table [settings]="settings" [source]="data"></ng2-smart-table>
  `,
})
export class BasicExampleMultiSelectComponent {

  settings = {
    selectMode: 'multi',
    columns: {
      id: {
        title: 'ID',
      },
      name: {
        title: 'Full Name',
      },
      username: {
        title: 'User Name',
      },
      email: {
        title: 'Email',
      },
    },
  };

  data = [
    {
      id: 1,
      name: 'Leanne Graham',
      username: 'Bret',
      email: 'Sincere@april.biz',
    },
    {
      id: 2,
      name: 'Ervin Howell',
      username: 'Antonette',
      email: 'Shanna@melissa.tv',
    },
    {
      id: 3, …
Run Code Online (Sandbox Code Playgroud)

javascript checkboxlist ng2-smart-table angular

13
推荐指数
1
解决办法
2410
查看次数

ng2-smart-table 缺少依赖项完成程序

我正在使用 Ng2SmartTable 并且出现此错误:

目标入口点“ng2-smart-table”中的错误缺少依赖项:-@akveo / ng2-completer

我已经尝试了以下命令,但它不起作用:

1.npm install --save ng2-smart-table

2.npm ng2-completer --save

3.npm i rxjs-compat --save

ng2-smart-table angular ng2-completer

10
推荐指数
2
解决办法
8315
查看次数

ng2-smart-table,后端分页(Spring)

我正在使用启用了Pager的后端服务器(Java Spring).我在HTTP调用上每页加载100条记录.

在angular2服务上,它使用"?page = 1&size = 100"作为初始调用的API调用,而在客户端大小的寻呼机上,它显示10并且最多移动10页,这很好.但我无法从服务器加载下一块数据.我检查了ServerDataSource并使用了.setPaging(1,100).

如何加载下一个数据块(2-200)以及如何实现此目的.任何提示都会有所帮助.

@Injectable()
export class AmazonService extends ServerDataSource {

constructor(protected http: Http) {
    super(http);
}

public getAmazonInformation(page, size): Observable<Amazon[]> {

    let url = 'http://localhost:8080/plg-amazon?page=1&size=100';
    this.setPaging(1, 100, true);
    if (this.pagingConf && this.pagingConf['page'] && 
       this.pagingConf['perPage']) {
          url += 
       `page=${this.pagingConf['page']}&size=${this.pagingConf['perPage']}`;
}

return this.http.get(url).map(this.extractData).catch(this.handleError);
}
Run Code Online (Sandbox Code Playgroud)

谢谢!

pagination web angular2-services ng2-smart-table angular

7
推荐指数
2
解决办法
5550
查看次数

尝试分叉节点模块ng2-smart-table

ng2-smart-table的开发已经停滞不前,我正在尝试为存储库构建一个fork,但它似乎没有构建.

我以前做过类似的事情,通常只是创建一个存储库的分支.放入我的更改,然后在我的主项目上修改package.json以指向github项目

但是,当我尝试为ng2-smart-table执行此操作时,我收到错误:无法安装git + https://github.com/atlantageek/ng2-smart-table.git#8f37d374a87a9008328aaea36ad6ce78a28ce7a8:缺少包版本

我也无法破译构建发布过程,开发人员对这些问题一无所知.有没有人有任何指导.

ng2-smart-table angular

6
推荐指数
1
解决办法
363
查看次数

在 Angular 6 中使用 ng2-smart-table 创建服务器端分页

我正在尝试使用该组件<ng2-smart-table>。我确实做到了,但是我需要在用户单击页面或列进行排序后刷新数据,有什么方法可以捕获这些事件并刷新数据?

table.component.html

<ng2-smart-table 
[settings]="settings" 
[source]="characters">
</ng2-smart-table>
Run Code Online (Sandbox Code Playgroud)

表.service.ts

import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';

@Injectable()
export class TableService {
  constructor(private http: HttpClient) { }
  url = 'http://localhost:4000';
  getCharacters() {
    return this
            .http
            .get(`${this.url}/characters`);
  }
}
Run Code Online (Sandbox Code Playgroud)

表.interface.ts

export interface Table {
   ticket: String;
   title: String;
   state: String;
   owner: String;
   age: String;
   priority: String;
}
Run Code Online (Sandbox Code Playgroud)

table.component.ts

import { Component, OnInit } from '@angular/core';
import { TableService } from './table.service';
import { Table } from './table.interface'; …
Run Code Online (Sandbox Code Playgroud)

typescript ng2-smart-table angular angular6

6
推荐指数
1
解决办法
9919
查看次数

如何在ng2-smart-table的下拉列表中设置多个选择?

在我的应用程序中,我在ng2-smart-table的下拉列表中加载了动态值.现在我必须在ng2-smart-table中的下拉列表中启用多个选择.

注意:下拉列表中的多项选择不是复选框.

ng2-smart-table angular6

6
推荐指数
1
解决办法
2329
查看次数

Angular2 ng2智能表排序

ng2-smart-table中,角度 2排序功能区分大小写.是否有任何选项可以使排序表数据不区分大小写

ng2-smart-table angular

5
推荐指数
2
解决办法
4532
查看次数

使用 AngularFire 和 Firestore 显示带有 Ng2 智能表的嵌套对象

1

以上是我在 Firebase 的 Firestore 数据库中的数据结构。我可以使用以下设置成功提取数据并将其放入 ng2 智能表中:

export const userTableSettings = {
  delete: {
confirmDelete: true,
deleteButtonContent: '<i class="ft-x danger font-medium-1 mr-2"></i>'
  },
  add: {
confirmCreate: true,
  },
  edit: {
confirmSave: true,
editButtonContent: '<i class="ft-edit-2 info font-medium-1 mr-2"></i>'
  },
  firstName: {
title: 'Full Name',
  },
  lastName: {
title: 'User Name',
  },
  email: {
title: 'Email',
  },
},
  attr: {
    class: 'table table-responsive'
  },
};
Run Code Online (Sandbox Code Playgroud)

但是当我为角色添加位置时

roles: {
    title: 'Role',
},
Run Code Online (Sandbox Code Playgroud)

输出是

在此处输入图片说明

我希望能够显示一个或多个用户角色(如果他们有多个角色),并且能够从表中更新它们。

firebase typescript ng2-smart-table google-cloud-firestore angular5

5
推荐指数
1
解决办法
4160
查看次数

Angular 5 + ng2-smart-table:有条件地隐藏/禁用操作列

我有一个由 ng2-smart-table 构建的表,表中的数据有两种状态DraftReady。当 时data.status = 'Draft',可以出于 CRUD 目的显示操作列,但随后状态更改为data.status = 'Ready',我想禁用操作列。如何有条件地做到这一点?

桌面设置:

  tableSettings = {
    add: {
      addButtonContent: '<i class="fas fa-plus fa-fw"></i>',
      createButtonContent: '<i class="fas fa-plus fa-fw"></i>',
      cancelButtonContent: '<i class="fas fa-times fa-fw"></i>',
      confirmCreate: true
    },
    edit: {
      editButtonContent: '<i class="fas fa-pencil-alt fa-fw"></i>',
      saveButtonContent: '<i class="fas fa-check fa-fw"></i>',
      cancelButtonContent: '<i class="fas fa-times fa-fw"></i>',
      confirmSave: true
    },
    delete: {
      deleteButtonContent: '<i class="far fa-trash-alt fa-fw"></i>',
      confirmDelete: true
    },

    columns: {
      title: {
        title: 'Title',
        type: 'text', …
Run Code Online (Sandbox Code Playgroud)

ng2-smart-table angular

5
推荐指数
2
解决办法
9883
查看次数

如何更新 ng2-smart-table 中的占位符文本?

我用于在应用程序ng2-smart-table中显示数据angular 6。我启用了过滤功能。现在我想将search所有占位符中的默认设置为文本columns。我已经搜索了很多。但我无法更改过滤器的占位符。

<ng2-smart-table [settings]="setting" [source]="dataSource"></ng2-smart-table>
Run Code Online (Sandbox Code Playgroud)

在 .ts 文件中。

add: {
  confirmCreate: false
},
columns: {
   id: {
    title: 'ID',
    filter: true        
  },
  name: {
    title: 'First Name',
    filter: true                
  },
}
Run Code Online (Sandbox Code Playgroud)

placeholder ng2-smart-table angular

5
推荐指数
1
解决办法
5749
查看次数