【发布时间】:2023-03-13 20:36:02
【问题描述】:
我有一些记录存储在 mysql 数据库中。我想使用 php 检索记录,然后根据用户过滤器(如价格范围、类型等)显示...
这应该会在用户点击过滤条件后立即发生(不会有任何提交按钮来应用过滤器)。
我们将非常感谢您的意见。
【问题讨论】:
-
搜索有关
PDO和SQL的内容
标签: javascript php mysql angularjs
我有一些记录存储在 mysql 数据库中。我想使用 php 检索记录,然后根据用户过滤器(如价格范围、类型等)显示...
这应该会在用户点击过滤条件后立即发生(不会有任何提交按钮来应用过滤器)。
我们将非常感谢您的意见。
【问题讨论】:
PDO和SQL的内容
标签: javascript php mysql angularjs
您可以通过 3 个步骤进行开发:
这里是:
HTML
<div ng-app="myApp">
<div ng-controller="example">
<table>
<thead>
<th ng-click="customOrder('value')">
<a href="#">digits</a>
</th>
<th ng-click="customOrder('text')">
<a href="#">owners</a>
</th>
</thead>
<tr ng-repeat="value in a_response | orderBy:orderMe">
<td>{{value.value}}</td>
<td>{{value.text}}</td>
</tr>
</table>
</div>
</div>
JS
var myApp = angular.module('myApp', []);
myApp.controller('example', ['$scope', function($scope) {
$scope.a_response = [{
value: 2,
text: 'Ivan'
}, {
value: 3,
text: 'Jack'
},{
value: 'text',
text: 'Stack'
}, {
value: 1,
text: 'Lack'
}];
$scope.orderMe = 'value';
$scope.customOrder = function(ordering) {
//TODO php request and a_resposne updating
$scope.orderMe = ordering;
};
}]);
希望我能帮上忙。
【讨论】: