Commit 081327cf authored by Shakarim Sapa's avatar Shakarim Sapa

- Добавлена передача дополнительного параметра key. Необходим для правильной группировки условий.

parent 2222d9a2
// Метод добавляющий новое условие
$(document).on('click', 'a.add_condition', function() { $(document).on('click', 'a.add_condition', function() {
var id = $(this).data('id'); var id = $(this).data('id');
var container = $(this).closest('div.btn-group').parent().children('div.conditions-block'); var container = $(this).closest('div.btn-group').parent().children('div.conditions-block');
var key = $(this).closest('tr').data('key');
$.ajax({ $.ajax({
url: '/triggers/trigger-admin/getconditionhtml', url: '/triggers/trigger-admin/getconditionhtml',
data: { data: {
id: id id: id,
key: key
}, },
method: 'GET', method: 'GET',
success: function(response) { success: function(response) {
...@@ -15,6 +18,7 @@ $(document).on('click', 'a.add_condition', function() { ...@@ -15,6 +18,7 @@ $(document).on('click', 'a.add_condition', function() {
}) })
}); });
// Метод добавляющий новую строку "И"
$(document).on('click', 'button.add-and-condition', function() { $(document).on('click', 'button.add-and-condition', function() {
var container = $(this).closest('table').children('tbody'); var container = $(this).closest('table').children('tbody');
......
...@@ -39,7 +39,7 @@ class TriggerAdminController extends AdminController { ...@@ -39,7 +39,7 @@ class TriggerAdminController extends AdminController {
return (Yii::$app->request->isAjax) ? Json::encode($result) : $result; return (Yii::$app->request->isAjax) ? Json::encode($result) : $result;
} }
public function actionGetconditionhtml($id){ public function actionGetconditionhtml($id, $key){
$condition = Conditions::init()->getConditionById($id); $condition = Conditions::init()->getConditionById($id);
$result = $this->renderPartial( $result = $this->renderPartial(
'condition-html', 'condition-html',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment