我有一个带有HTML表的角度js html页面.这有大约100行.用户选择10或15行并进行后端呼叫.后端调用使用$ .ajax({...})进行处理和更新数据库.处理完成后,后端会将2或3条记录返回到屏幕.这些返回的对象将具有新状态和一些新值.所以我需要将这些状态同步回我的范围内的同一个对象,以便它们反映在屏幕上.
我知道我们可以遍历每个对象并更新状态.但是由于数据的大小太高(有时甚至是1000行),我想知道角度是否有任何现成的功能来完成这项工作.如果Angular中没有这样的功能,请建议任何其他可以帮助我的免费开源工具.
我在这里附上代码片段.出于保密原因,我将问题转换为客户帐户方案
<table >
<thead >
<tr>
<th >Customer Name</th>
<th >Account Number</th>
<th >Status </th>
<th >Date</th>
</tr>
</thead>
<tbody ng-repeat="customer in customerList">
<tr ng-repeat="account in customer.accounts" >
<td>{{customer.name}}</td>
<td>{{account.acctNum}}</td>
<td>
<input type="checkbox" ng-model="account.acctId" ng-change="selectThisAccount(account)" /> {{account.status}}
</td>
<td>{{account.activationTimestamp}}</td>
</tr>
</tbody>
</table>
<input type="button" value="Activate Accounts" ng-click="activateAccounts()" />
Controller
===========
$scope.customerList = ....
// I have my customer list retrieved by way of another call and the data is assigned to the scope.customerList variable
$scope.selectedAccounts = …Run Code Online (Sandbox Code Playgroud) 我在同时使用 Oracle 的 union 和 order by 子句时遇到问题。
我有两个复杂的查询(其中包含子查询),每个查询都有一个 order by 子句。我需要合并两者的输出并返回结果。当我运行它时,我收到错误 ORA-00933:SQL 命令未正确结束。
但当我注释掉它们中的 order by 子句时,它就起作用了。
为了测试这一点,我创建了一个简单的查询,如下所示
select * from employee where employee_id=2 order by name
union
select * from employee where employee_id=3 order by name;
Run Code Online (Sandbox Code Playgroud)
即使在使用 order by 子句运行时也会出现相同的错误,但当我注释掉 order by 子句时运行良好。
我尝试搜索论坛,但无法找到确切问题的解决方案。我在ORACLE Query with ORDER BY 和 UNION中找到了一个,但是由于子查询和太多表之间的联接,我的查询已经太复杂了,我不想实现这个。
有人可以帮助我解决问题的根本原因吗?
我使用谷歌表格图表显示一些数据作为表格.根据行上的状态值,我必须更改行的背景颜色.所以我必须动态显示多种颜色.我检查了表格图表文档并在线搜索.但是找不到这样的功能.请帮忙.