Added example rules and values

This commit is contained in:
Georgy Litvinov 2020-08-19 17:09:13 +02:00
parent e45db04fcc
commit 2ab80c74cb
4 changed files with 42 additions and 43 deletions

View file

@ -764,7 +764,7 @@ p.external-auth a.blue:hover {
/* HOME SEARCH ------> */
#search-home {
float: left;
/* width: 533px; */
width: 100%;
margin: 30px 0 0 0;
}
#search-home h3 {

View file

@ -2,12 +2,12 @@ var rules_basic = {
condition: 'AND',
rules: [{
id: 'category',
operator: 'equal',
id: 'text',
operator: 'contains',
value: 2
}, {
id: 'category',
operator: 'equal',
id: 'keywords',
operator: 'contains',
value: 1
}]
@ -15,51 +15,50 @@ var rules_basic = {
$('#builder').queryBuilder({
filters: [{
id: 'name',
label: 'Name',
type: 'string'
id: 'text',
label: 'Текст',
type: 'string',
operators: ['contains', 'not_contains']
}, {
id: 'category',
label: 'Category',
id: 'keywords',
label: 'Ключевые слова',
type: 'string',
operators: ['contains', 'not_contains']
}, {
id: 'title',
label: 'Название',
type: 'string',
operators: ['contains', 'not_contains']
}, {
id: 'bibliography',
label: 'Библиография',
type: 'string',
operators: ['contains', 'not_contains']
}, {
id: 'classgroup',
label: 'Тип документа',
type: 'integer',
input: 'select',
values: {
1: 'Books',
2: 'Movies',
3: 'Music',
4: 'Tools',
5: 'Goodies',
6: 'Clothes'
1: 'Статья',
2: 'Отрывок'
},
operators: ['equal', 'not_equal']
operators: ['contains']
}, {
id: 'in_stock',
label: 'In stock',
id: 'rubrics',
label: 'Рубрикация',
type: 'integer',
input: 'radio',
input: 'select',
values: {
1: 'Yes',
0: 'No'
1: 'История философии',
2: 'Логика',
3: 'Философия языка',
4: 'Этика',
5: 'Эстетика',
6: 'Философия техники'
},
operators: ['equal']
}, {
id: 'price',
label: 'Price',
type: 'double',
validation: {
min: 0,
step: 0.01
}
}, {
id: 'id',
label: 'Identifier',
type: 'string',
placeholder: '____-____-____',
operators: ['equal', 'not_equal'],
validation: {
format: /^.{4}-.{4}-.{4}$/
}
}],
operators: ['contains', 'not_contains']
} ],
lang_code: 'ru',
rules: rules_basic
});

View file

@ -18,7 +18,7 @@ var QueryBuilder = $.fn.queryBuilder;
QueryBuilder.regional['ru'] = {
"__locale": "Russian (ru)",
"add_rule": "Добавить",
"add_rule": "Добавить условие",
"add_group": "Добавить группу",
"delete_rule": "Удалить",
"delete_group": "Удалить",