Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Table Pagination Label #20

Closed
Fardinak opened this issue Jun 23, 2015 · 18 comments
Closed

Table Pagination Label #20

Fardinak opened this issue Jun 23, 2015 · 18 comments

Comments

@Fardinak
Copy link

The md-data-table-pagination label ("Rows per page:") has been hard-coded which is not the ngMaterial way, and specially a problem when creating apps in non-english languages.

@daniel-nagy
Copy link
Owner

This is a valid point. I'll try to fit this in to the next release.

daniel-nagy pushed a commit that referenced this issue Jun 24, 2015
@daniel-nagy
Copy link
Owner

resolved in version 0.4.6 :)

@Fardinak
Copy link
Author

That looks good; although, I believe that it should extend to the of as well! i.e. "x - y of n"

@daniel-nagy daniel-nagy reopened this Jun 24, 2015
daniel-nagy pushed a commit that referenced this issue Jun 27, 2015
@shivasingh0101
Copy link

Failed to load template: templates.md-data-table-progress.html...
i am getting this error message and also rest of the templates are not being loaded in the local server.

@daniel-nagy
Copy link
Owner

@shivasingh0101 that's strange, what version of Angular are you using?

@shivasingh0101
Copy link

@daniel-nagy angular 1.4.0

@shivasingh0101
Copy link

image

This is the error showing on my browser...

@daniel-nagy
Copy link
Owner

Either they are not being loaded into the template cache or the template cache is somehow getting emptied?

@shivasingh0101
Copy link

Is there any issue with webpack coz we are using webpack to build our app....

@shivasingh0101
Copy link

And one more thing it worked when i loaded the js and css files into my main js file but still the pagination is not working i mean its redirecting to the next page when i pressed next button but data is not rebinding i tried rebinding the data its showing in the console but not onto the page.

error_image2

@Fardinak
Copy link
Author

Is having a page number against the guidelines?
If not so, you could provide variables like $start, $end, $count, $total, $page, $totalPages (like $index, $first, $last, etc. in ngRepeat) so the developer can format their own label like this:

<md-data-table-pagination md-label="$start - $end of $total (page $page of $totalPages)">

That gives away some flexibility of representation; page numbers are more useful in most cases!

IMO, it would look way better than the current API anyway! 😜

@Fardinak
Copy link
Author

@daniel-nagy any comments on the latest suggestion?

@webpartisan
Copy link

I use angular-translate and would be good to use it with md-label together. Now there is no two-way binding with md-label and I can't change translation dynamically

@felansu
Copy link

felansu commented Dec 13, 2015

+1

@gabrielAnzaldo
Copy link

Agree with @webpartisan I can not change the label dinamically with angular translate.

@Pelu2k12
Copy link

+1

@volmerf
Copy link

volmerf commented Jan 12, 2016

We also agree with @webpartisan that there is no 2-way binding currently. Switching the language of the website will not switch the language of the mdLabel. Only on refreshing the page the translation is triggered.

This is our code:

vm.updateTranslations();
$rootScope.$on('$translateChangeSuccess', updateTranslations);

function updateTranslations(event) {

            $translate(['GENERAL.PAGINATION.PAGE', 'GENERAL.PAGINATION.ROWS_PER_PAGE', 'GENERAL.PAGINATION.OF']).then(function (translations) {
                vm.paginationLabel.page = translations['GENERAL.PAGINATION.PAGE'];
                vm.paginationLabel.rowsPerPage = translations['GENERAL.PAGINATION.ROWS_PER_PAGE'];
                vm.paginationLabel.of = translations['GENERAL.PAGINATION.OF'];
            });
        }

Changing the language will trigger the updateTranslations function but will not update the label.

@raulsperoni
Copy link

@shivasingh0101 could you solve this? i'm facing the same problem...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants