1
저는 bower (아래 json 파일)와 함께 작업하고 있습니다.ngGrid가 제대로 표시되지 않습니다.
간단한 ngGrid를 시작하지 못했습니다. 그리 간단하지는 않습니다. 그리드 그리니치 내가 뭘 잘못하고 있는지 모르겠다.
index.jade :
div(ng-controller='Ctrl')
div(style="border: 1px solid rgb(212,212,212); width : 400px; height: 300px", ng-grid='gridOptions')
controller.coffee :
'use strict'
angular.module('client.controllers', [])
.controller('Ctrl', [
'$log'
'$scope'
($log, $scope) ->
$scope.gridOptions = {
data: 'myData'
enablePinning: true
columnDefs: [
{ field: "name", width: 120, pinned: true },
{ field: "age", width: 120 },
{ field: "birthday", width: 120 },
{ field: "salary", width: 120 }
]
}
$scope.myData = [
{ name: "Moroni", age: 50, birthday: "Oct 28, 1970", salary: "60,000" }
{ name: "Tiancum", age: 43, birthday: "Feb 12, 1985", salary: "70,000" }
{ name: "Jacob", age: 27, birthday: "Aug 23, 1983", salary: "50,000" }
{ name: "Nephi", age: 29, birthday: "May 31, 2010", salary: "40,000" }
{ name: "Enos", age: 34, birthday: "Aug 3, 2008", salary: "30,000" }
{ name: "Moroni", age: 50, birthday: "Oct 28, 1970", salary: "60,000" }
{ name: "Tiancum", age: 43, birthday: "Feb 12, 1985", salary: "70,000" }
{ name: "Jacob", age: 27, birthday: "Aug 23, 1983", salary: "40,000" }
{ name: "Nephi", age: 29, birthday: "May 31, 2010", salary: "50,000" }
{ name: "Enos", age: 34, birthday: "Aug 3, 2008", salary: "30,000" }
{ name: "Moroni", age: 50, birthday: "Oct 28, 1970", salary: "60,000" }
{ name: "Tiancum", age: 43, birthday: "Feb 12, 1985", salary: "70,000" }
{ name: "Jacob", age: 27, birthday: "Aug 23, 1983", salary: "40,000" }
{ name: "Nephi", age: 29, birthday: "May 31, 2010", salary: "50,000" }
{ name: "Enos", age: 34, birthday: "Aug 3, 2008", salary: "30,000" }
]
])
와 내가 받고 있어요 것은 :
이물의 JSON :
{
"name": "main",
"version": "0.0.0",
"authors": [
"gumba"
],
"license": "MIT",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"dependencies": {
"querystring":"*",
"angular": "*",
"angular-sanitize": "*",
"angular-resource": "*",
"angular-route": "*",
"angular-cookies": "*",
"angular-mocks": "*",
"bootstrap": "*",
"sugarjs": "*",
"datatables":"*",
"ng-grid":"*"
}
}
고정을 제거한 경우 작동합니까? true입니까? 또한 포함하는 DIV의 정의 된 너비가 차이가 나는 경우 결합 된 모든 열 너비보다 작습니다. – Scott
고정 된 속성을 제거하려고했지만 변경하지 않았습니다. 폭 계산은 의도적입니다 (고정 된 피쳐를 사용하기 위해) – Gumba
대신 새 uiGrid를 사용해 볼 수 있습니다. 나는 당신이 보는 것처럼 어떤 문제없이 그것을 사용하고 있습니다. 어쩌면 CSS 관련 문제처럼 보입니다. 내가 사용하는 브라우저의 디버거에서 다양한 스타일과 바이올린을 확인해 보겠습니다. – Scott