EasyUI Forum
September 14, 2025, 01:53:38 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
  Home Help Search Login Register  
  Show Posts
Pages: [1]
1  General Category / EasyUI for jQuery / Re: searchbox: setting message if not found. on: January 14, 2019, 09:00:12 AM
I finally managed to implement it in the same look an feel as the original error message tooltip. Here it is:

Code:
$.extend($.fn.searchbox.methods, {
showError: function(jq, text) {
return jq.each(function() {
                var textbox = $(this).searchbox('textbox');
textbox
        .addClass('textbox-invalid')
.tooltip({
content: text,
position: "right",
deltaX: 24
})
.tooltip('show')
.tooltip('tip').css({
color: "#000",
borderColor: "#CC9933",
backgroundColor: "#FFFFCC"
});
});
}
});

And to call it just use

Code:
	$('#search').searchbox('showError','Not found');       

Where the searchbox is defined with the 'search' ID:

Code:
<input id="search" class="easyui-searchbox" style="width:300px"
data-options="prompt:'Please Input Value'">
2  General Category / EasyUI for jQuery / Re: searchbox: setting message if not found. on: December 20, 2018, 10:13:27 AM
Sorry Jarry, but it does not answer my question.

My question is not how to make the search field required, but rather how to show the "tooltip"  similar to the "This field is required", BUT with:

  • custom text
  • later, after the return from asynchronous doSearch() function specified by "searcher:".

There seems to be no obvious way of doing it.

Your help is greatly appreciated!
 
3  General Category / EasyUI for jQuery / Re: how to bind a keyup function to searchbox? on: December 19, 2018, 10:49:53 AM
.. or you can bind custom validator to the searchbox. It's like:

Code:
$.extend($.fn.validatebox.defaults.rules, {
    valdatorFunction: {
        validator: function(value, param) {
if (value == undefined)
return true;
                        // validate value here. If OK - return true, else - false
        },
        message: 'Invalid syntax'
    }
});

and also

Code:
	$('#search').searchbox({
    searcher: doSearch,
    prompt: 'Enter search string'
})
.searchbox('textbox').validatebox({          // set custom validator
   required: false,
   validType:'validatorFunction[0]'     // [0] is the parameter passed to validator function
});
}
4  General Category / EasyUI for jQuery / searchbox: setting message if not found. on: December 19, 2018, 08:45:18 AM
Hi!

I am using searchbox like this:

Code:
<input id="search" style="width:200px;">

and

Code:
	$('#search').searchbox({
     searcher: doSearch,
   prompt: 'Enter search string'
});

In case doSearch() is unsuccessful I'd like to set the error message on the searchbox  similar to



but - of course - with different text, like "not found".

Is it possible? If so - how?

Thanks in advance!
5  General Category / EasyUI for jQuery / treegrid Jquery: folder is converted to file after all children are removed. on: August 23, 2018, 06:00:10 AM
Hi!

I am writing an app presenting some tree-like structure, similar to file structure on disk. I found that after last child is removed folder icon is replaced by file. This is not how file system behaves - even if you remove all files folder stays folder. Similarly replacing the folder by file is not the desired behavior for my app.

Looking at the code of jquery.ui.min.js I see that this is done intentionally. Here is a snippet inside of DeleteRow:

   var _a15 = del(id);
   if (_a15) {
         if (_a15.children.length == 0) {
         tr = opts.finder.getTr(_a14, _a15[opts.idField]);
         tr.next("tr.treegrid-tr-tree").remove();
         var cell = tr.children("td[field=\"" + opts.treeField + "\"]").children("div.datagrid-cell");
         cell.find(".tree-icon").removeClass("tree-folder").addClass("tree-file");
         cell.find(".tree-hit").remove();
         $("<span class=\"tree-indent\"></span>").prependTo(cell);
      }
   }

So my question is: besides just commenting out this code - which I would hate to do - can you propose some more legitimate way of achieving what I want to achieve? Something with prototyping?

Thanks!
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!