Permalink
Browse files

display number of results in associations search

  • Loading branch information...
1 parent 9e02b76 commit 51668a4e21119e804efa22d1b99ff948343095aa Spiros Ioannou committed Apr 30, 2012
Showing with 37 additions and 9 deletions.
  1. +22 −1 CHANGELOG.txt
  2. +11 −7 js/jquery.quicksearch.js
  3. +4 −1 php/itemform.php
View
23 CHANGELOG.txt
@@ -6,11 +6,32 @@ LEGEND:
I:improvement
B:bugfix
-1.6 -> 1.7
+1.6 -> 1.7 24/4/2012
-------------------------------------------------------------------------------------------------------
B:removed date checking from buggy validation pugin and leaved it to
B:fixed browsing bug where same starting category was repeated on subtrees
I:updated jstree version
++:new update instructions
++:gui-based database version upgrade
+B:fixed getdb.php for php 5.3 when error reporting was enabled
+B:fixed tag association listing
+B:item insert failed for IE in some cases
+I:viewrack links open in new window
+B:removed some js commas for picky IE8
++:rack menu-less popup window support.
++:status icons in racks
+B:fixed cookie problem if itdb installed without the /itdb prefix
+I:editagent name
+I:better rack view
++:view dns in racklist
+I:better phpinfo.php sqlite version detection
++:edit file types
++:use agent 'service' url as vendor servicetag link in itemform
+I:Stylistic unification in editagents
++:removed previous clutter, added timezone to settings
+B:small other fixes
+B:removed date checking from buggy validation pugin and leaved it to -:fixed browsing bug where same starting category was repeated on subtrees
+
DB UPGRADE 1.6 -> 1.7
-----------------------------
View
18 js/jquery.quicksearch.js
@@ -1,12 +1,11 @@
jQuery(function ($) {
$.fn.quicksearch = function (target, opt) {
-
var timeout, cache, rowcache, jq_results, val = '', e = this, options = $.extend({
delay: 100,
selector: null,
stripeRows: ['even', 'odd'],
loader: null,
- noResults: '',
+ noResults: '', //display this id when no results found
bind: 'keyup',
onBefore: function () {
return;
@@ -23,15 +22,16 @@ jQuery(function ($) {
}, opt);
this.go = function () {
-
var i = 0, noresults = true, vals = val.toLowerCase().split(' ');
-
var rowcache_length = rowcache.length;
+ var matchno=0;
+ var nxt;
for (var i = 0; i < rowcache_length; i++)
{
if (this.test(vals, cache[i]) || val == "") {
options.show.apply(rowcache[i]);
noresults = false;
+ matchno++;
} else {
options.hide.apply(rowcache[i]);
}
@@ -45,13 +45,19 @@ jQuery(function ($) {
}
this.loader(false);
+
+ // display number of results
+ nxt=this.next();
+ if (nxt.attr('class')=='nres') {
+ nxt.text(matchno);
+ }
+
options.onAfter();
return this;
};
this.stripe = function () {
-
if (typeof options.stripeRows === "object" && options.stripeRows !== null)
{
var joined = options.stripeRows.join(' ');
@@ -99,9 +105,7 @@ jQuery(function ($) {
};
this.cache = function () {
-
jq_results = $(target);
-
if (typeof options.noResults === "string" && options.noResults !== "") {
jq_results = jq_results.not(options.noResults);
}
View
5 php/itemform.php
@@ -1004,6 +1004,7 @@
<div id='tab5' class='tab_content'>
<h2><input style='color:#909090' id="softfilter" name="softfilter" class='filter'
value='Filter' onclick='this.style.color="#000"; this.value=""' size="20">
+ <span style='font-weight:normal;' class='nres'>xx</span>
</h2>
<?php
//////////////////////////////////////////////
@@ -1022,14 +1023,15 @@
</thead>
<tbody>
<?php
-
+$xx=0;
while ($ir=$sth->fetch(PDO::FETCH_ASSOC)) {
if ($ir['islinked']) {
$cls="class='bld'";
}
else
$cls="";
+ $xx++;
echo "<tr><td><input name='softlnk[]' value='".$ir['id']."' ";
if ($ir['islinked']) echo " checked ";
echo " type='checkbox' /></td>".
@@ -1043,6 +1045,7 @@
?>
</tbody>
</table>
+ <?php echo "$xx"?> Software listed
</div>

0 comments on commit 51668a4

Please sign in to comment.