mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-21 17:48:43 +02:00
Advanced search: WIP POC, integration with endpoint.
SVN:b1162[5402]
This commit is contained in:
@@ -784,16 +784,23 @@ div.HRDrawer {
|
||||
.search_form_handler .sf_criterion_area .search_form_criteria {
|
||||
display: inline-block;
|
||||
margin-right: 3px;
|
||||
/* Special criterion processing */
|
||||
}
|
||||
.search_form_handler .sf_criterion_area .search_form_criteria.locked {
|
||||
background-color: #f1f1f1;
|
||||
}
|
||||
.search_form_handler .sf_criterion_area .search_form_criteria .sfc_title {
|
||||
cursor: pointer;
|
||||
}
|
||||
.search_form_handler .sf_criterion_area .search_form_criteria .sfc_form_group {
|
||||
display: none;
|
||||
}
|
||||
.search_form_handler .sf_criterion_area .search_form_criteria .sfc_form_group.opened {
|
||||
display: block;
|
||||
}
|
||||
.search_form_handler .sf_criterion_area .search_form_criteria.search_form_criteria_raw .sfc_title {
|
||||
cursor: initial;
|
||||
}
|
||||
.search_form_handler .sf_criterion_area .sf_more_criterion .sf_mc_list {
|
||||
position: absolute;
|
||||
margin: 0px;
|
||||
|
||||
@@ -885,7 +885,7 @@ div.HRDrawer {
|
||||
}
|
||||
}
|
||||
.sfc_title{
|
||||
|
||||
cursor: pointer;
|
||||
}
|
||||
.sfc_form_group{
|
||||
display: none;
|
||||
@@ -894,6 +894,13 @@ div.HRDrawer {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
/* Special criterion processing */
|
||||
&.search_form_criteria_raw{
|
||||
.sfc_title{
|
||||
cursor: initial;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* More criterion */
|
||||
|
||||
@@ -141,27 +141,31 @@ $(function()
|
||||
// Fill criteria
|
||||
this._setTitle();
|
||||
},
|
||||
// - Set the title element
|
||||
_setTitle: function(sTitle)
|
||||
{
|
||||
if(sTitle === undefined)
|
||||
{
|
||||
// TODO: Make nice label
|
||||
sTitle = this.options.field.label + ': ' + this._getValuesAsText();
|
||||
}
|
||||
this.element.find('.sfc_title').text(sTitle);
|
||||
},
|
||||
|
||||
|
||||
// Values helpers
|
||||
// - Convert values to a standard string
|
||||
_getValuesAsText: function()
|
||||
{
|
||||
var aValues = [];
|
||||
for(var iValueIdx in this.options.values)
|
||||
{
|
||||
aValues.push(this.options.values[iValueIdx].value);
|
||||
aValues.push(this.options.values[iValueIdx].label);
|
||||
}
|
||||
|
||||
return aValues.join(', ');
|
||||
},
|
||||
// - Make an OQL expression from the criteria values and operator
|
||||
_makeOQLExpression: function()
|
||||
{
|
||||
var aValues = [];
|
||||
|
||||
@@ -43,6 +43,10 @@ $(function()
|
||||
this._super( key, value );
|
||||
},
|
||||
|
||||
//------------------
|
||||
// Inherited methods
|
||||
//------------------
|
||||
|
||||
// DOM element helpers
|
||||
_prepareElement: function()
|
||||
{
|
||||
|
||||
@@ -9,6 +9,7 @@ $(function()
|
||||
// default options
|
||||
options:
|
||||
{
|
||||
operator: 'contains',
|
||||
},
|
||||
|
||||
// the constructor
|
||||
@@ -43,6 +44,10 @@ $(function()
|
||||
this._super( key, value );
|
||||
},
|
||||
|
||||
//------------------
|
||||
// Inherited methods
|
||||
//------------------
|
||||
|
||||
// DOM element helpers
|
||||
_prepareElement: function()
|
||||
{
|
||||
@@ -65,13 +70,5 @@ $(function()
|
||||
})
|
||||
.appendTo(this.element.find('.sfc_form_group'));
|
||||
},
|
||||
_setTitle: function(sTitle)
|
||||
{
|
||||
if(sTitle === undefined)
|
||||
{
|
||||
sTitle = this.options.field.label + ': ' + this._getValuesAsText();
|
||||
}
|
||||
this._super(sTitle);
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
@@ -339,6 +339,8 @@ $(function()
|
||||
// Show loader
|
||||
this._showLoader();
|
||||
|
||||
// TODO: Make a throttle mecanism or cancel previous call when a newer is made.
|
||||
|
||||
// Do submit
|
||||
$.post(
|
||||
this.options.endpoint,
|
||||
|
||||
Reference in New Issue
Block a user