Code Monkey home page Code Monkey logo

ng-mazdik's Introduction

Angular UI component library

npm i ng-mazdik-lib --save

Styles

Add global styles in angular.json

"styles": [
  "src/styles.css",
  "node_modules/ng-mazdik-lib/styles/bundled.css"
],

Demos

Sample crud-table

Feature-rich data table component for Angular with CRUD operations.

import {Component}  from '@angular/core';
import {ColumnBase, CdtSettings, DataSource, DataManager, Validators} from 'ng-mazdik-lib';
import {DemoService} from './samples/services';

@Component({
  selector: 'my-app',
  template: `<app-crud-table [dataManager]="dataManager"></app-crud-table>
  <app-notify></app-notify>`
})

export class PlayersComponent {

    dataManager: DataManager;
    columns: ColumnBase[] = [
        {
            title: 'Id', 
            name: 'id', 
            sortable: false, 
            filter: false, 
            frozen: true,
            resizeable: false,
            formHidden: true,
        },
        {
            title: 'Name', 
            name: 'name', 
            frozen: true, 
            width: 250,
            validatorFunc: Validators.get({required: true, minLength: 2, pattern: '^[a-zA-Z ]+$'}),
            editable: true,
        },
        {
            title: 'Race',
            name: 'race',
            type: 'select',
            options: [
                { id: 'ASMODIANS', name: 'ASMODIANS' },
                { id: 'ELYOS', name: 'ELYOS' },
            ],
            editable: true,
        },
        {
            title: 'Cascading Select',
            name: 'note',
            editable: true,
            type: 'select-dropdown',
            options: [
                { id: 'ASM1', name: 'ASM note 1', parentId: 'ASMODIANS' },
                { id: 'ASM2', name: 'ASM note 2', parentId: 'ASMODIANS' },
                { id: 'ASM3', name: 'ASM note 3', parentId: 'ASMODIANS' },
                { id: 'ASM4', name: 'ASM note 4', parentId: 'ASMODIANS' },
                { id: 'ELY1', name: 'ELY note 1', parentId: 'ELYOS' },
                { id: 'ELY2', name: 'ELY note 2', parentId: 'ELYOS' },
                { id: 'ELY3', name: 'ELY note 3', parentId: 'ELYOS' },
            ],
            dependsColumn: 'race',
            multiSelectFilter: true,
        },
        {
            title: 'Gender',
            name: 'gender',
            type: 'radio',
            options: [
                { id: 'MALE', name: 'MALE' },
                { id: 'FEMALE', name: 'FEMALE' },
            ],
            editable: true,
        },
        {
            title: 'Exp',
            name: 'exp',
            type: 'number',
            validatorFunc: Validators.get({required: true, minLength: 2, maxLength: 10}),
            editable: true,
        },
        {
            title: 'Last online', 
            name: 'last_online', 
            type: 'date',
            editable: true,
        },
        {
          title: 'Account name',
          name: 'account_name',
          editable: true,
          type: 'select-popup',
          optionsUrl: 'assets/accounts.json',
          keyColumn: 'account_id',
        },
        {
          title: 'Account id',
          name: 'account_id',
          formHidden: true,
          tableHidden: true,
        }
    ];
    settings: CdtSettings = new CdtSettings({
        crud: true,
        bodyHeight: 380
    });

    constructor(private demoService: DemoService) {
      const service = this.demoService; // your custom service
      this.dataManager = new DataManager(this.columns, this.settings, service);
    }
}

Sample data-table

import {ColumnBase, Settings, DataTable} from 'ng-mazdik-lib';

@Component({
  selector: 'app-data-table-demo',
  template: `<app-data-table [table]="dataTable"></app-data-table>`
})

export class DataTableDemoComponent {

  dataTable: DataTable;
  columns: ColumnBase[];
  settings: Settings;

  constructor() {
    this.dataTable = new DataTable(this.columns, this.settings);
    this.dataTable.rows = data[];
  }
}

Sample tree-table

import {ColumnBase, Settings, TreeTable} from 'ng-mazdik-lib';
import {TreeDemoService} from './tree-demo.service';

@Component({
  selector: 'app-tree-table-demo',
  template: `<app-tree-table [treeTable]="treeTable"></app-tree-table>`
})

export class TreeTableDemoComponent {

  treeTable: TreeTable;
  settings: Settings;
  columns: ColumnBase[];

  constructor(private treeService: TreeDemoService) {
    this.treeTable = new TreeTable(this.columns, this.settings, this.treeService);
  }
}

Features

  • Filtering (column filters and an optional global filter)
  • Sorting (multiple columns)
  • Pagination
  • Modal (draggable and resizable)
  • Create/Update/Delete (composite primary keys)
  • Single row view (with sortable colums and values)
  • Loading indicator
  • Row selection (single, multiple, checkbox, radio)
  • Scrolling with fixed header horizontally and vertically
  • Frozen columns
  • Dynamic forms with validation
  • Modal select list (with search and pagination)
  • Editable
  • Localization
  • Column resizing
  • Cascading select (client/server side dynamic drop-down lists)
  • Tree table (flatten/unflatten tree, lazy loading)
  • Row Grouping (multiple columns)
  • Summary Row (aggregation on a column)
  • Live Updates
  • Virtual scroll with dynamic row height
  • Header and Cell Templates
  • Keyboard navigation
  • Export Data to CSV
  • No external dependencies

Custom service

export class YourService implements DataSource {
}

interface DataSource {
  getItems(requestMeta: RequestMetadata): Promise<PagedResult>;
  getItem(row: any): Promise<any>;
  post(row: any): Promise<any>;
  put(row: any): Promise<any>;
  delete(row: any): Promise<any>;
  getOptions?(url: string, parentId: any): Promise<any>;
}
export interface RequestMetadata {
  pageMeta: PageMetadata;
  sortMeta: SortMetadata[];
  filters: FilterMetadata;
  globalFilterValue?: string;
}
export interface PagedResult {
  items: any[];
  _meta: PageMetadata;
}
export interface PageMetadata {
  currentPage: number;
  perPage: number;
  totalCount?: number;
  pageCount?: number;
  maxRowCount?: number;
}

Column

Attribute Type Default Description
name string null
title string null
sortable boolean true
filter boolean true
options SelectItem[] null
optionsUrl string null
width number null
frozen boolean false
type text / password / number / select / radio / checkbox / textarea / date / datetime-local / month / select-popup / select-dropdown null
validatorFunc (name: string, value: any) => string[] null
editable boolean false
resizeable boolean true
dependsColumn string null
cellTemplate TemplateRef null
formTemplate TemplateRef null
headerCellTemplate TemplateRef null
formHidden boolean false
tableHidden boolean false
cellClass string / Function null
headerCellClass string null
keyColumn string null
multiSelectFilter boolean false
minWidth number 50
maxWidth number 500
aggregation sum / average / max / min / count null
filterValues (columnName: string) => Promise<SelectItem[]> / SelectItem[] / string null
dataType string /number /date null
formDisableOnEdit boolean false
pipe PipeTransform null

Settings

Attribute Type Default Description
bodyHeight number null
sortable boolean true
filter boolean true
multipleSort boolean false
trackByProp string null
groupRowsBy string[] null
selectionMultiple boolean false
selectionMode checkbox / radio null
virtualScroll boolean false
rowClass string / Function false
rowHeight number 30 px
rowNumber boolean true
hoverEvents boolean false mouseover/mouseout
contextMenu boolean false event
editMode editCellOnDblClick / editProgrammatically editCellOnDblClick
paginator boolean true
rowHeightProp string null row.$$height
isEditableCellProp string null row.$$editable

CdtSettings extends Settings

Attribute Type Default Description
crud boolean false
initLoad boolean true
globalFilter boolean false
singleRowView boolean true
exportAction boolean false csv
columnToggleAction boolean false
clearAllFiltersAction boolean false
clearAllFiltersIcon boolean true
export interface SelectItem {
  id: any;
  name: string;
  parentId?: any;
}

Sample event subscriptions

import {Subscription} from 'rxjs';

private subscriptions: Subscription[] = [];

  ngOnInit() {
    const subSelection = this.table.events.selectionSource$.subscribe(() => {
      this.table.getSelection();
    });
    this.subscriptions.push(subSelection);
  }

  ngOnDestroy() {
    this.subscriptions.forEach(s => s.unsubscribe());
  }

Sample translate

import {DtMessages, DtMessagesEn} from 'ng-mazdik-lib';

messages: DtMessages = new DtMessagesEn({
  empty: 'No data to display',
  titleDetailView: 'Item details',
  titleCreate: 'Create a new item'
});
this.dataManager = new DataManager(this.columns, this.settings, this.service, this.messages);

Lib

Componnent Description
app-context-menu
app-dropdown-select
app-dynamic-form
app-inline-edit, [inline-edit]
app-notify with NotifyService
app-modal
app-modal-edit-form
app-modal-select
app-pagination
app-row-view
app-scroller, [scroller] virtual scroll
app-select-list
dt-toolbar
tree
app-tree-view
app-dual-list-box
[appResizable]
[appDraggable]
[appDroppable] html5
[appDropdown]

Templates

<app-data-table[table]="table">
  <ng-template dtHeaderTemplate></ng-template>
  <ng-template dtRowGroupTemplate let-row="row"></ng-template>
</app-data-table>

ng-mazdik's People

Contributors

mazdik avatar winpzs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ng-mazdik's Issues

Update Row properties on the Fly possible ?

Hello @mazdik

I am seeing "prepareTreeData" method , the expand / collapse state is initialing.

I want a Trigger Button , which will Expand the Tree (nth level) and collapse. Can we do that ?

rows.forEach(x => { x.$$height = (x.$$level > 0) ? 0 : null; x.expanded = !(x.$$level == 0);//!(x.$$level > 0) x.$$editable = !x.hasChildren; });

Merge Row (oldRow.merge)

After last update, merge row not working.

afterUpdate(row: Row, result: any) {
    if (this.refreshRowOnSave) {
      this.refreshRow(row);
    } else {
      this.mergeRow(row, result || row);
    }
  }
mergeRow(oldRow: Row, newRow: any) {
    oldRow.merge(newRow);
    this.events.onRowsChanged();
  }

The oldRow not working merge.

JSON structure generalisation

Hello @mazdik

you have defined JSON as per the datatable demand.. If we want to change the json attribute names (i.e data, children to dataEntity, ChildrenEntity) different name, then do we need to change the core files in tree.ts , tree-node.ts etc ???

[ { "id": "ASMODIANS", "name": "ASMODIANS", "dataEntity": { "name": "Defunct", "gender": "MALE", "cube_size": "1", "exp": 777777 }, "ChildrenEntity": [ { "id": "MALE", "name": "MALE",

select-dropdown first option not working on first select

for type "select-dropdown" in data table, when it is empty selection initially, during selecting first option and navigate away, it will always empty, have to select second option or else then only selecting back option one success.

Thanks.

FLASK API Service not working

I am having trouble getting the demo to connect to a FLASK API service. I replaced the data in the "players.json" file with my test data, so i know my table formatting is good because the table loads fine from the json file, it just wont connect to my api.

I created a new "RestlessService.ts" and call that from "basic-demo.components.ts", tried to follow your suggested code in the readme as best i could.

The page loads when i do "npm start" but i get a http error pop up:

`
TypeError: Cannot read property 'toLowerCase' of undefined
    at HttpXsrfInterceptor.push../node_modules/@angular/common/fesm5/http.js.HttpXsrfInterceptor.intercept (http.js:1721)
    at HttpInterceptorHandler.push../node_modules/@angular/common/fesm5/http.js.HttpInterceptorHandler.handle (http.js:1135)
    at HttpInterceptingHandler.push../node_modules/@angular/common/fesm5/http.js.HttpInterceptingHandler.handle (http.js:1772)
    at MergeMapSubscriber.project (http.js:975)
    at MergeMapSubscriber.push../node_modules/rxjs/_esm5/internal/operators/mergeMap.js.MergeMapSubscriber._tryNext (mergeMap.js:61)
    at MergeMapSubscriber.push../node_modules/rxjs/_esm5/internal/operators/mergeMap.js.MergeMapSubscriber._next (mergeMap.js:51)
    at MergeMapSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.next (Subscriber.js:54)
    at Observable._subscribe (scalar.js:5)
    at Observable.push../node_modules/rxjs/_esm5/internal/Observable.js.Observable._trySubscribe (Observable.js:43)
    at Observable.push../node_modules/rxjs/_esm5/internal/Observable.js.Observable.subscribe (Observable.js:29)
push../src/ng-crud-table/services/restless.service.ts.RestlessService.handleError @ restless.service.ts:111
push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke @ zone.js:391
onInvoke @ core.js:17289
push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke @ zone.js:390
push../node_modules/zone.js/dist/zone.js.Zone.run @ zone.js:150
(anonymous) @ zone.js:889
push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask @ zone.js:423
onInvokeTask @ core.js:17280
push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask @ zone.js:422
push../node_modules/zone.js/dist/zone.js.Zone.runTask @ zone.js:195
drainMicroTaskQueue @ zone.js:601
Promise.then (async)
scheduleMicroTask @ zone.js:584
push../node_modules/zone.js/dist/zone.js.ZoneDelegate.scheduleTask @ zone.js:413
push../node_modules/zone.js/dist/zone.js.Zone.scheduleTask @ zone.js:238
push../node_modules/zone.js/dist/zone.js.Zone.scheduleMicroTask @ zone.js:258
scheduleResolveOrReject @ zone.js:879
ZoneAwarePromise.then @ zone.js:1012
push../node_modules/@angular/core/fesm5/core.js.PlatformRef.bootstrapModule @ core.js:17793
./src/main.ts @ main.ts:11
__webpack_require__ @ bootstrap:78
0 @ tree-table-module.ts:20
__webpack_require__ @ bootstrap:78
checkDeferredModules @ bootstrap:45
webpackJsonpCallback @ bootstrap:32
(anonymous) @ main.js:1
`

basic-demo.component.ts

`
import {Component, OnInit} from '@angular/core';
import {Column, CdtSettings, DataManager, RestlessService} from '../../ng-crud-table';
//import {DemoService} from './demo.service';
import {PlayersComponent} from './RestlessService';
import {getColumnsPlayers} from './columns';
import {SelectItem} from '../../lib/common';
import {DtMessages} from '../../lib/dt-translate';

@Component({
  selector: 'app-basic-demo',
  template: `<app-crud-table [dataManager]="dataManager"></app-crud-table>`,
  providers: [RestlessService]
})

export class BasicDemoComponent implements OnInit {

  columns: Column[];
  dataManager: DataManager;

  settings: CdtSettings = <CdtSettings>{
    crud: true,
    bodyHeight: 380,
    exportAction: true,
    globalFilter: true,
    columnToggleAction: true,
  };

  messages: DtMessages = <DtMessages>{
    titleDetailView: 'Customer details',
    titleCreate: 'Create a new Customer'
  };

  constructor(private service: RestlessService) {
    this.columns = getColumnsPlayers();
    this.columns[4].filterValues = this.filterValuesFunc;
    this.dataManager = new DataManager(this.columns, this.settings, this.service, this.messages);
    this.dataManager.pager.perPage = 20;
  }

  ngOnInit() {
  }

  filterValuesFunc(columnName: string): Promise<SelectItem[]> {
    return new Promise((resolve) => {
      setTimeout(() => resolve(
        [
          {id: 'MALE', name: 'MALE'},
          {id: 'FEMALE', name: 'FEMALE'},
        ]
      ), 1000);
    });
  }

}

`

RestlessService.ts

`
import {Component}  from '@angular/core';
import {HttpClient} from '@angular/common/http';
import {Column, CdtSettings, DataSource, RestlessService, DataManager} from '../../ng-crud-table/';
import {Validators} from '../../lib/validation/validators';
import { NotifyService } from 'src/lib/notify';

@Component({
  selector: 'my-app',
  template: `<app-crud-table [dataManager]="dataManager"></app-crud-table>
  <app-notify></app-notify>`,
  providers: [RestlessService]
})

export class PlayersComponent {

    dataManager: DataManager;
    service: RestlessService

    constructor(private http: HttpClient) {
      // YiiService | RestlessService | OrdsService | your custom service
      
      this.service = new RestlessService(this.http, new NotifyService());
      this.service.url = 'http://127.0.0.1:5000/api/customers';
      this.service.primaryKeys = ['custID'];
      this.dataManager = new DataManager(this.columns, this.settings, this.service);
    }

    columns: Column[] = [
        {
          title: 'custID',
          name: 'custID',

          sortable: true,
          filter: true,
          //frozen: true,
          //width: 100,
          //formHidden: true,
          type: 'number',
        },
        {
          title: 'custName',
          name: 'custName',
          sortable: true,
          filter: true,
          //validatorFunc: Validators.get({required: true, minLength: 2, pattern: '^[a-zA-Z ]+$'}),
          editable: true,
        },
        {
          title: 'pcc',
          name: 'pcc',
          sortable: true,
          filter: true,
          //validatorFunc: Validators.get({required: true, minLength: 2, pattern: '^[a-zA-Z ]+$'}),
          editable: true,
        },
        {
          title: 'gds',
          name: 'gds',
          sortable: true,
          filter: true,
          //validatorFunc: Validators.get({required: true, minLength: 2, pattern: '^[a-zA-Z ]+$'}),
          editable: true,
        },
        {
          title: 'businessUnit',
          name: 'businessUnit',
          sortable: true,
          filter: true,
          //validatorFunc: Validators.get({required: true, minLength: 2, pattern: '^[a-zA-Z ]+$'}),
          editable: true,
        },
        {
          title: 'subBusinessUnit',
          name: 'subBusinessUnit',
          sortable: true,
          filter: true,
          //validatorFunc: Validators.get({required: true, minLength: 2, pattern: '^[a-zA-Z ]+$'}),
          editable: true,
        
    ];

    settings: CdtSettings = {
        crud: true,
        tableWidth: 820,
        bodyHeight: 380,
        multipleSort: true
    };

}

Export All

Hi, is that a way to export all table content base on filter? (instead of the current page only)

for example, base on the filter, the total rows is 300 over total 500 rows, but pagination only shows 100 per rows, I would like to export all 300 rows.

thanks in advance.

Possible to mark cell changed indicator to RowAction

Is that a way to make the RowAction have an indicator like cell changed indicator on the top right of each cell? If there is one cell in that row have value changed, the RowAction will have an indicator as well.

That would be great for a large number of rows when scrolling through, some might miss out the cell changed indicator. Since RowAction will be the easiest way to refer if there is any row changed.

An indicator or background color highlight for RowAction would be great.

Help is much appreciated. Thanks in advance.

Annotation 2019-08-28 104353

Propagating live updates

Hello, I opened this new one to not go off-topic on the other post. I was trying the live demo updates, and it's working, my list of items is updated every 2 seconds. But I noticed that the updated data is not propagated inside the Update item form, I bounced back and forth between functions but I'm not sure what to do. The problem is that my items are updated every 2 seconds, but when I open the Update form to update an item, I want the form input values to update every 2 seconds too. What would you suggest? I don't want to mess the code badly

headerRowHeight css can setting to 20px from 40px?

usually datable display data, RowHeight no need too high.
i had modify min-height to 25px. and rowHeight i want to setting to 25 ,but char not center align
.datatable-header-row {
min-height: 20px;
}

Methods not working

Hello, I'm trying from couple days to integrate your crud table in my project, I have followed the steps such as creating my service implementing DataSource etc. but I have now a few problems, I got the table to displaying my items, so the GET works, but I have an error in my console that I'll paste here. Also global filter is not working for me for some reason, and I don't know why Delete is giving me 400 Error. I'll paste here the main error which is displayed in the console as soon as I route on the component.
Immagine2

cell font-size,can your add font-size&line-height binding?

can you add @HostBinding('style.font-size.px') and line-height ? we can define the cell font-size and line-height , so ,function same as Powerbuilder ( DataWindow)
because I make ng-curd-table to web elements, no need setting global css

dt-body-cell-edit tabindex="-1" ng-reflect-table="[object Object]" ng-reflect-cell="[object Object]" class="datatable-body-cell dt-sticky" role="gridcell" data-column-index="1" data-row-index="0" style="**line-height: 1.3;font-size:12px;**width: 200px; left: 140px;"

Update/Filter column values

@mazdik
Is there any way to update the column values based on Filter condition.
Example: Toggle Button to decide to Show the Column result either in Percentage or in Number.

Expectation

<ng-template #column4 let-row="row" let-value="value" let-column="column"> {{row.totalCount}} </ng-template>

On filter change "{{row.totalCount}}" need to replace by "{{row.Percentage}}"

Edit cell with dependsColumn not working

In the basic demo, the "Cascading Select" is depending on the column "Race".
Here I attached the image :

image

But as you can see the column "Cascading Select" is displaying all the options without depending on the column "Race". But in update dialog it depends on the column "Race".
Here I attached the image :

image

Is this intentional or bug ? If this intentional can u help with workaround for edit in cell able to dependsColumn.

Thanks !

Pre-Select Checkbox in Tree Table based on JSON data

Hello @mazdik

Can it be possible to Pre-Select Checkbox based on JSON received from service on DataTable.

ex: [
{
"id": "1",
"name": "ASMODIANS",
"isSelected" : true,
"data": {
*****

Something like below might possible by adding a new attribute to data transformer

[transformer = (node: TreeNode, level: number) => {
const data = {
expandable: true,
$$level: level,
$$checked: node.isSelected,
hasChildren: (node.children && node.children.length > 0)
};
How to add "$$checked" here to selection object ???

Tree Table Checkbox Selection Issue

Hi Mazdik,

There is a bug if i am not mistaken, If i am selecting the Level 1 checkbox, and expand the tree, it should select the upcoming child nodes as well.

Also if on Tree Expanded mode checkbox checked , and the Tree collapse , then other Tree Node get selected.

image

Reload the table data

Can you help us with understanding of reload only table data in "TreeTableCustomDemoComponent"

this.http.get<any[]>('assets/tree.json').subscribe(data => {

Table column reorder not updating view

I want to reorder table column , when i change column order and title of column on a button and click value changes reflect on table.colmn data , but not the view.

The view is not updated after the data change.

I tried with ChangeDetectorRef , but it also updating the view.

Here is the stackblitz Demo

Do data table support "Dynamic column loading"

Hello @mazdik

Can you suggest , how can we support to load "Columns" from Database ?

Do we need to have separate API call for column definition , because i am seeing the columns get initialize before the data load.

constructor(private http: HttpClient) { this.columns = getTreeColumns(); this.dataTable = new DataTable(this.columns, this.settings, null);

No Horizontal Scroll Bar for Frozen Column.

Hello @mazdik

Can you add one example in demo section , where we also have Fixed Frozen Column with no Horizontal Scroll Bar for it.

Is it possible to have Scroll Bar (Horizontal) starting from the scrollable column. For the Frozen columns , there no scroll bar present as visible following picture.

Update >>>

@mazdik , you have CSS blog where (http://mazdik.ru/note/css/table-with-fixed-headers-and-left-columns-v4) have the same behavior.

Do above behavior possible in Data Table with Frozen Column ?

Row Level Filter facility available ?

In Tree Table module , how can we implement Row Level filter.

Example : There are 10 rows , out of which 5 rows have 'Status' Completed , 5 Rows have Status Incomplete.

Filter need to show Completed Record / Not Completed Records

Columns from object

If i want to bind column field from inner object like this
{
"areaId": 1,
"areaName": "Area 1",
"areaCode": "002",
"clientId": 1,
"client": {
"clientId": 1,
"clientName": "South Beach",
"clientCode": "0001"
}
}
how bind clientName

How to use ColumnResizeMode

If we have defined the column width in 'px', can we change on the fly while open in High Resolution Windows

getOptions in service

I'm using ASP NET CORE in back-end, when I call the method this.service.getOptions for populate select-options component.
Method:

  loadOptions() {
    if (this.column.optionsUrl && this.service.getOptions) {
      this.loading = true;
      this.service.getOptions(this.column.optionsUrl, this._dependsValue).then((res) => {
        this._options = res;
        this.loading = false;
        this.setDefaultSelect();
      }).catch(error => {
        this._options = [];
        this.loading = false;
      });
    }
  }

This method receive one array the options.

@Input()
  set options(val: any[]) {
    this._options = val;
    if (this._options) {
      this.optionsCopy = [...val];
    }
    this.selectedName = this.getName();
  }

But with the request processing time, the initial value becomes undefined, and thus does not populate the ModalSelectComponent.

Getting in load, however when clicking under the modal page, the already processed value is loaded normally.

What can be done for this case?

Save All for multiple rows changes

I am using the crud table from basic-demo, is there a way I can get all changes made to multiples rows, and I can customize my own Save All button to trigger save at once?

After the user changing multiple different rows/columns, it would be nice if they decide to Save All at once.

Your help is very much appreciated. Thanks.

server side pagination

hi, currently the pagination is requesting from API for every row in DB and then paginate it. for example, i have 1000 rows in my DB. every time i click on next page it request through API and the API returns the same 1000 rows.

I might have do something wrong here. is there any way to send current page and limit through the API to reduce the loading time of the table ?

How to disable the left side menu based on data

Hi Mazdik,

I am using "app-crud-table" in my application. I have following two requirements to fulfill. Can you please suggest how to achieve these?

  1. Disable to left side menu based on a property in data (for example: "isdeleted").
  2. Alternate color for row background

Here is a sample of my data:
[ { "id":1, "userteam":{"username":"John Salgat", "teamname":"Dev"}, "roles":[1,2], "rolenames":["Developer","Tester"], "isactive": true, "isdeleted": false }, { "id":2, "userteam":{"username":"Frank Castellon", "teamname":"Dev"}, "roles":[1], "rolenames":["Developer"], "isactive": true, "isdeleted": false }, { "id":3, "userteam":{"username":"Frank Castellon", "teamname":"Executive"}, "roles":[3], "rolenames":["Knowledge Manager"], "isactive": true, "isdeleted": false }, { "id":4, "userteam":{"username":"Jeff Rigsby", "teamname":"Executive"}, "roles":[4], "rolenames":["Operations Manager"], "isactive": true, "isdeleted": true } ]

Thanks.

Post Request

How to use POST option kindly share any sample how to post data to web api in virtual scrolling

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.