-
Notifications
You must be signed in to change notification settings - Fork 338
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Table buttons and check box columns not working #569
Comments
Hi, I'm currently at the airport, I may be able to give you a more detailed answer tomorrow or so. For the time being, in regards to 2). In regards to 4), I have never tried that, but you can have an external class that exports a constant. This constant variable can be an array of strings that would be your columns. Mese |
Hi Themese, Thanks for the reply, as I say I am new to angular so still trying to get my head around how it all works and integrates. I fully understand creating and using Regular Expressions but in the code how would I apply this to the filter? Would it not be simpler to have a pipe converting the passed in data and the table data to a single case? I am going to try the export const and see how I go, my array however does not only contain strings. Thanks |
Hi Folks Solved Point 4: I created a file called MyColumns.ts as shown below: export const MyColumns:Array = Then in my and then where I had the columns definitions before I have: Hope this helps others. |
Point 2 -filtering you convert both string to lowercase as stated in #152 ? Point 3 - The problem was that was I was trying to assign the value or function to their variable was wrong and also it needed a boolean function to stop it calling the data variable before I had done the assignment.
In Moved public ngOnInit(): void { Then in my getUserList() funnction getUserList() { Points 2-4 are now solved |
I solved myself point 2 with a similar solution to the issue you noted. In regards to 1) I honestly can´t help you much with it, I'm not an experte and I can´t see what is wrong with your json. Sorry for that. Mese |
Hi Themese, Thank you for your reply and help, Angular is now starting to make more sense. I can see that angularJS has export functionality, but the next thing I am looking at is giving the users the ability to export the table as csv or excel as well as a pdf documents, do we have an example on h ow this can be done with NG2-table, as part of this I would also need to be able to allow the users to select the columns to view prior to just exporting the on screen view. Thanks |
I have made some progress in the html file I have a button that is a drop down and I want to populate it using and *ngfor loop so people can select the columns using a check box to show which columns are visible on the table. My code is populating the drop down list but I cannot work out how to get the check box to be visible in my drop down list.
Secondly I have followed https://github.com/jdelgadoalfonso/ng2-table/tree/master/demo/components/buttons to add buttons to my table and the table compiles and I get no console or compile errors but the buttons do not appear on my table, apart from his 3 files and the import statements do I need anything else? Thanks |
Can´t help you with the csv export functionality, but probably you can find another plugin that will help you. In regards to the button, are you sure you are not missing any css or something like that? I can´t see why it won't work. |
Thanks Themese, all help is greatly appreciated. My columndefs file: export const MyColumnsDef:Array = tablebuttons.css file: div.ok_button { div.edit_button { div.cancel_button { }` TableButtons .ts file: @component({ private _editMode: boolean = false; Unless I have missed something this is what is in the table button files the guy has in his table. Unless you can see something I have missed. Thanks |
Is anyone else able to advise why the buttons may not be present |
Created a custom ng2-table component and then worked from their |
Hi
I am new to Angular 2 and have got your demo table working but have a few points I want to clarify:
I have taken over a project from a previous developer and so am having to learn angular 2 but have some issues still lingering which I would like to solve:
A number of same error as shown below for "has no exported member 'Renderer2'."
[default] C:\wamp\www\nationalgrid\public_cli\node_modules@ng-bootstrap\ng-bootstrap\buttons\radio.d.ts:1:10
Module '"C:/wamp/www/nationalgrid/public_cli/node_modules/@angular/core/index"' has no exported member 'Renderer2'.
I do not want to use render 2 as that is angular 4 and this clients system has to be on angular 2 for the time being. What have I imported or done to be getting this error?
Package.json
{
"name": "a2-cli-app",
"version": "0.0.0",
"license": "MIT",
"angular-cli": {},
"scripts": {
"start": "ng serve",
"lint": "tslint "src/**/*.ts"",
"test": "ng test",
"pree2e": "webdriver-manager update",
"e2e": "protractor"
},
"private": true,
"dependencies": {
"@angular/common": "^2.2.1",
"@angular/compiler": "^2.2.1",
"@angular/core": "^2.2.1",
"@angular/forms": "^2.2.1",
"@angular/http": "^2.2.1",
"@angular/platform-browser": "^2.2.1",
"@angular/platform-browser-dynamic": "^2.2.1",
"@angular/router": "^3.2.1",
"angular2-cookie": "^1.2.5",
"bootstrap": "^3.3.7",
"chart.js": "^2.4.0",
"core-js": "^2.4.1",
"ng2-bs3-modal": "^0.10.4",
"ng2-charts": "1.4.1",
"ng2-file-upload": "1.1.4-2",
"ng2-pagination": "1.0.1",
"ng2-toastr": "1.3.2",
"rxjs": "5.0.0-beta.12",
"ts-helpers": "^1.1.1",
"zone.js": "^0.6.23"
},
"devDependencies": {
"@angular/compiler-cli": "^2.2.1",
"@types/jasmine": "2.5.38",
"@types/node": "^6.0.42",
"angular-cli": "1.0.0-beta.21",
"codelyzer": "~1.0.0-beta.3",
"jasmine-core": "2.5.2",
"jasmine-spec-reporter": "2.5.0",
"karma": "1.2.0",
"karma-chrome-launcher": "^2.0.0",
"karma-cli": "^1.0.1",
"karma-jasmine": "^1.0.2",
"karma-remap-istanbul": "^0.2.1",
"protractor": "4.0.9",
"ts-node": "1.2.1",
"tslint": "3.13.0",
"typescript": "~2.0.3",
"webdriver-manager": "10.2.5",
"webpack": "^3.4.1"
}
}
If you need more details to help on this just let me know what you need.
In relation to your filtering on your simple data table how can I set the filtering to be case in-sensative?
I can see you get your data from the table-data.ts as Array I have my data coming into this project from a mysql database base as an Array, but how do I assign it to the data variable.
As you have private data:Array = TableData;, but if I try and change the "TableData" to anything else the code just give me errors and does not load, even once I have update the columns Array definition to match my incoming data.
columns:Array = [
{title: 'Name', name: 'name'},
{title: 'Position', name: 'position', sort: ''},
{title: 'Office', className: ['office-header', 'text-success'], name: 'office', sort: 'asc'},
{title: 'Extn.', name: 'ext', sort: ''},
{title: 'Start date', className: 'text-warning', name: 'startDate'},
{title: 'Salary ($)', name: 'salary'},
];
Thanks in advance hope I have not asked over dumb questions
The text was updated successfully, but these errors were encountered: