ErickRuano / angular-pivot

Angular wrapper for Nicolas Kruchten's Pivot Table
MIT License
15 stars 12 forks source link

Change localization parameters #1

Open ghost opened 7 years ago

ghost commented 7 years ago

Hi,

Great job with the Angular Integration of PivotTable.js library...

I have a dute, how I can to change the "locale" parameter of PivotUI() method, to change the entire localization of rendered UI?

Thank you!

ErickRuano commented 7 years ago

Hi,

Let me add options support, it should be quick.

ghost commented 7 years ago

Thank you for your answer... El El jue, 10 nov 2016 a las 14:38, Erick Ruano notifications@github.com escribió:

Hi,

Let me add options support, it should be quick.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ErickRuano/angular-pivot/issues/1#issuecomment-259691760, or mute the thread https://github.com/notifications/unsubscribe-auth/AKZRJEAD9RIAAbk6Fu2FraY7jK5Er5vmks5q8x5QgaJpZM4KufoL .

Pavel del Pozo

ErickRuano commented 7 years ago

Hey Pavel, please update your version to v1.2.1. I already had some minor improvements and now added support for an options object through the ng-pivot-options attribute. Here you whould be able to pass your locales.

<div ng-pivot="data" ng-pivot-options="options"></div>
$scope.data = [
    {color: "blue", shape: "circle"},
    {color: "red", shape: "triangle"}
];

$scope.options = {
    rows: ["color"],
    cols: ["shape"]
   // Here you would add a locale : "es" or whatever you pass here.
};

Please let me know if issue is resolved.

Bests!

ghost commented 7 years ago

Hi again,

Something don't works properly... After update like you tell me, I change my pivottable/bower.json to load sortly the correct libraries: { "name": "pivottable", "description": "Javascript Pivot Table (aka Pivot Grid, Pivot Chart, Cross-Tab) implementation with drag'n'drop", "version": "2.3.0", "main": [ "dist/pivot.js", "dist/pivot.es.js", "dist/pivot.css" ], "license": "MIT", "ignore": [ "examples" ], "keywords": [ "pivot", "crosstab", "grid", "table", "pivottable", "pivotgrid", "pivotchart", "jquery" ], "homepage": "http://nicolas.kruchten.com/pivottable", "repository": { "type": "git", "url": "git://github.com/nicolaskruchten/pivottable.git" }, "dependencies": { "jquery": ">=1.9.0" } }

In the browser console network, appears correct loading both pivot.js & pivot.es.es

In my angular controller: `/* global angular */ (function () { 'use strict';

angular
        .module('app.config.pivottable')
        .controller('ConfigPivotTableController', ConfigPivotTableController);

function ConfigPivotTableController($scope, $compile) {
    var vm = this;

    vm.data = [{ name : "Erick", age : "23" }, { name : "Diego", age : "28" }];

    vm.options = {
        locale: "es"
    };

    $scope.$on('$viewContentLoaded', function () {

    });

}

})();`

And in my html page: <div class="full-width full-height" ng-pivot="vm.data" ng-pivot-options="vm.options"></div>

But when i try to run the project, the pivot-table still showing in english language...

Any error or warning is showed in console browser debug window...

Do you have any suggestion?