mohdrashid / ng2-listview-crud Goto Github PK
View Code? Open in Web Editor NEWThis is a Angular JS 2/4 module that can be included in projects to automatically render a listview with built-in create, delete, update, read and search.
This is a Angular JS 2/4 module that can be included in projects to automatically render a listview with built-in create, delete, update, read and search.
As you can see in attached screenshot I have created two lists. There are few issues I have identified
` <div class="row" *ngIf="marketDataSource;" >
</div>`
where listMarket and ListResidualMarketGroup are List view properties defined as below
`this.listMarket = {
add: false,
remove: false,
edit: false,
dataIsObject: true,
//path: ["description"],
path: ["name"],
label: "Made For Markets",
headingBackgroundColor: "#3752ff",
headingFontColor: "white",
icon: "fa fa-cogs",
onDelete: function (value) {
return true;
},
onUpdate: function (value, newValue) {
return true;
},
onSearch: function (value) {
},
onAdd: function (value) {
return true;
},
onSelect: function (value) {
console.log(JSON.stringify(value));
},
onSearchChange: function (value) {
console.log("kapil")
}
};
this.listResidualMarketGroup = {
add: false,
remove: false,
edit: false,
dataIsObject: true,
//path: (this.localvariables.ApplicationCode == "P" ? ["description"] : ["r2mGroupDescription"]),
path:["last"],
label: "Residual Market Groups",
headingBackgroundColor: "#3752ff",
headingFontColor: "white",
icon: "fa fa-cogs",
onDelete: function (value) {
return true;
},
onUpdate: function (value, newValue) {
return true;
},
onSearch: function (value) {
},
onAdd: function (value) {
return true;
},
onSelect: function (value) {
console.log(JSON.stringify(value));
},
onSearchChange: function (value) {
console.log("kapil")
}
};`
where is defined as
.html page
<ng2-listview-crud [properties]="listView" [data]="dataSource"></ng2-listview-crud>
.ts page
`import { Component, Input, EventEmitter, Output, IterableDiffers } from '@angular/core';
import { CommonModule } from '@angular/common';
import { GroupDescriptor, process, State } from '@progress/kendo-data-query';
import { ItemData } from '../common/base.component';
import { Ng2ListViewCRUD, Ng2ListViewCRUDProperty } from 'ng2-listview-crud';
import { ListViewModule } from 'ng2-list-view';
@component({
selector: 'listitem',
template: require('./listItem.component.html'),
})
export class ListItemComponent {
@Input()
public listView: Ng2ListViewCRUDProperty;
@Input()
public dataSource: Array<Object>;
}`
issue is.. if I select first item in List 1 ... the onselect event gets fired for both of the list...
here in console both the records (from list1 and list2) are fired.
Am I implementing this incorrectly ??
Thanks for help..
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.