Skip to content
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

col_defs not working as expected #127

Open
jhnbyrn opened this issue Feb 5, 2017 · 1 comment
Open

col_defs not working as expected #127

jhnbyrn opened this issue Feb 5, 2017 · 1 comment

Comments

@jhnbyrn
Copy link

jhnbyrn commented Feb 5, 2017

My model has a field called "name". By default this shows up with a table header of "name". I'd like it to appear in the header as "Name" so I added the following definition of col_defs:

    $scope.col_defs = [
	{ field: "name",
	  displayName: "Name"},
    ];

But instead of changing the "name" header to "Name", it simply added an extra column called "Name" with the same data. Am I doing something wrong? Thanks!

@torsten-sauer
Copy link

Hi @thinkingbraindog,

sorry for the late response! You should note, that the first column is the "expand property" and is internally called "Name" (with big N). So if you want to change it's heading, you have to provide the expand-on property for the grid.

Example (not full code):
In the html page:
<tree-grid expand-on="vm.treeExpandProperty" ...

In the controller:

vm.treeExpandProperty = {
        field: "Name",
        displayName: " "
    };

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

No branches or pull requests

2 participants