我的用例非常简单.在编辑Cell(enableCellEdit:true)之后,用户应该将数据"自动"发送到服务器(在单元格模糊时).我尝试了不同的方法,但没有一个方法得到适当的解决.我有一个简约的网格:
// Configure ng-grid
$scope.gridOptions = {
data: 'questions',
enableCellSelection: true,
selectedItems: $scope.selectedRow,
multiSelect: false,
columnDefs: [
{field: 'id', displayName: 'Id'},
{field: 'name', displayName: 'Name'},
{field: 'answers[1].valuePercent', displayName: 'Rural', enableCellEdit: true}
]
};
Run Code Online (Sandbox Code Playgroud)
例如,我试图观察传递给Grid的数据模型.但这样做不会返回我编辑的单元格:
$scope.$watch('myData', function (foo) {
// myModel.$update()
}, true);
Run Code Online (Sandbox Code Playgroud)
我试图摆弄"ngGridEventData"数据事件,但在单元格编辑后它不会触发
$scope.$on('ngGridEventData', function (e, gridId) {
// myModel.$update()
});
Run Code Online (Sandbox Code Playgroud)
最后,我试图观察一个Cell.但是,这仅适用于网格的"selectedCell"属性的行:
$scope.selectedRow = [];
$scope.gridOptions = {
selectedItems: $scope.selectedRow,
}
$scope.$watch('selectedRow', function (foo) {
console.log(foo)
}, true);
Run Code Online (Sandbox Code Playgroud)
它是否需要ng-grid插件?我不敢相信它不是开箱即用的东西.
你有一个指针/片段如何解决自动保存/发送到服务器?
我想开始学习Web API,我需要在我的visual studio 2010上进行设置.
为了开始,我查看了关于在vs 2010上安装和配置web API的在线教程,其中一些让我很困惑并决定就此问专家建议.
我有几个关于Web API的基本问题.
我确信这几个问题的答案可以帮助其他想要在VS 2010上开始使用Web API的用户.
对此有任何帮助,我们非常感谢
使用Angular Grid,我在console.log中获取ajax get数据.但是空格.
控制台日志显示:
[13:56:11.411] now!!
[13:56:11.412] []
[13:56:11.412] now!!
[13:56:11.556] <there is data returned from console.log(getData); >
Run Code Online (Sandbox Code Playgroud)
这是js文件.
// main.js
var app = angular.module('myApp', ['ngGrid']);
var getData = [];
function fetchData() {
var mydata = [];
$.ajax({
url:'/url/to/hell',
type:'GET',
success: function(data) {
for(i = 0, j = data.length; i < j; i++) {
mydata[i] = data[i];
}
getData = mydata;
console.log(getData);
}
});
}
fetchData();
app.controller('MyCtrl', function($scope) {
console.log('now!!')
console.log(getData)
console.log('now!!')
$scope.myData = getData
$scope.gridOptions = {
data: 'myData', …Run Code Online (Sandbox Code Playgroud) 我遇到了boostrap3的问题,它的默认背景是:透明!重要; 打印设置.
我需要在我的webapp中显示热图并使这些可打印.
我正在使用ng-style指令来动态计算所需的背景颜色.
简而言之,这是html的一部分
<div class="heatmap" ng-style="scalecolor(10)">lorem ipsum</div>
Run Code Online (Sandbox Code Playgroud)
这是控制器部分
$scope.scalecolor = function(perc) {
return { backgroundColor: plnkUtils.scaleColorInt('#EE0000', '#88FF00', perc) }
};
Run Code Online (Sandbox Code Playgroud)
但是,因为bootstrap3使用!important关键字将所有背景设置为透明,所以我无法打印这些.
这是bootstrap 3.1.0 css的一部分导致缺少背景颜色的问题:
@media print {
* {
color: #000 !important;
text-shadow: none !important;
background: transparent !important;
box-shadow: none !important;
}
}
Run Code Online (Sandbox Code Playgroud)
由于背景的反转:透明!重要; 是背景:颜色十六进制代码!重要; (请参阅此处)我正在尝试使用ng-style设置它,但是当我尝试这样时,exclamantion标记会导致Angularjs翻转:
$scope.scalecolor = function(perc) {
return { backgroundColor: plnkUtils.scaleColorInt('#EE0000', '#88FF00', perc) !important }
};
Run Code Online (Sandbox Code Playgroud)
或者当我在html模板中尝试这个时
ng-style="scalecolor(10) !important"
Run Code Online (Sandbox Code Playgroud)
谁知道如何使用带有Angularjs ng-style指令的!important css关键字来覆盖bootstrap3通配符?
对于那些想要亲眼看到这一点的人来说, 这里有一个关注这个问题的人
我想知道如何在加载数据之前显示一个简单的加载器.我正在使用ng-grid-1.3.2我正在使用Google搜索,但我没有找到任何示例.再见
如何在ng-grid中创建(或访问)所选行的数组?
id | default value | definition
-----------------------------------------------
selectedItems | [] | all of the items selected in the grid.
In single select mode there will only
be one item in the array.
Run Code Online (Sandbox Code Playgroud)
<body ng-controller="MyCtrl">
<div class="gridStyle" ng-grid="gridOptions"></div>
<h3>Rows selected</h3>
<pre>{{selectedItems}}</pre>
</body>
Run Code Online (Sandbox Code Playgroud)
var app = angular.module('myApp', ['ngGrid']);
app.controller('MyCtrl', function($scope) {
$scope.myData = [{name: "Moroni", age: 50},
{name: "Tiancum", age: 43},
{name: "Jacob", age: 27},
{name: "Nephi", age: 29},
{name: "Enos", age: 34}];
$scope.gridOptions = …Run Code Online (Sandbox Code Playgroud) data-binding angularjs angularjs-directive angularjs-scope ng-grid
我用ng-grid设置了以下内容:
var gridData = {};
$scope.gridOptions = {
data: 'gridData',
enableCellEdit: true,
multiSelect: false,
columnDefs: [
{ field: 'testId', displayName: 'Test Id' },
{ field: 'name', displayName: 'Name', enableCellEdit: true, editableCellTemplate: cellEditableTemplate },
{ field: 'description', displayName: 'Description', enableCellEdit: true, editableCellTemplate: cellEditableTemplate },
{ field: '', cellTemplate: '<button ng-click="delete(row)">Delete</button>' }
]
};
Run Code Online (Sandbox Code Playgroud)
和:
$scope.delete = function (row) {
row.entity.$deleteData({ testId: row.entity.testId });
}
Run Code Online (Sandbox Code Playgroud)
这会将HTTP消息发送到删除该行的服务器.但是该行仍然保留在网格中.我怎么能这样做,所以单击行上的删除按钮也会从gridData对象中删除一行?
我编码了以下内容:
$scope.gridOptions = {
data: 'myData',
enableCellEdit: true,
multiSelect: false,
columnDefs: [
{ field: 'Id', displayName: 'Id' },
{ field: 'Name', displayName: 'Name', enableCellEdit: true, editableCellTemplate: cellEditableTemplate },
{ field: 'Description', displayName: 'Description', enableCellEdit: true, editableCellTemplate: cellEditableTemplate }
]
};
Run Code Online (Sandbox Code Playgroud)
myData实际上包含四个列ID,名称,状态和描述.status是一个简单的javascript数组,有三种类型的状态叫做myStatus.
是否有可能以某种方式将myStatus中的数据链接到ng-grid中的字段,以便我可以从选择下拉列表中选择一个新值?
列出Visual Studio 2017安装的已安装组件的最佳方法是什么?
我知道我可以启动Visual Studio安装程序 > 修改并查看那里的工作负载或单个组件.
但是似乎没有办法将已安装的组件列表提取到txt文件中?
(我现在正在制作截图以记录我的内容)
有什么办法吗?例如,我可以运行Windows Studio Installer命令行吗?
angularjs ×8
ng-grid ×7
javascript ×2
angular-ui ×1
asp.net ×1
data-binding ×1
installation ×1
webforms ×1