|
@@ -788,37 +788,13 @@ function autocomplete()
|
|
|
$(this).attr('autocomplete', 'new-password');
|
|
|
});
|
|
|
}
|
|
|
-
|
|
|
- $.widget( "custom.catcomplete", $.ui.autocomplete, {
|
|
|
- _create: function() {
|
|
|
- this._super();
|
|
|
- this.widget().menu( "option", "items", "> :not(.ui-autocomplete-category)" );
|
|
|
- },
|
|
|
- _renderMenu: function( ul, items ) {
|
|
|
- var that = this,
|
|
|
- currentCategory = "";
|
|
|
- $.each( items, function( index, item ) {
|
|
|
- var li;
|
|
|
- if ( item.category != currentCategory ) {
|
|
|
- ul.append( "<li class='ui-autocomplete-category' style='font-weight: bold;padding: .2em .4em;margin: .8em 0 .2em;line-height: 1.5;'>" + item.category + "</li>" );
|
|
|
- currentCategory = item.category;
|
|
|
- }
|
|
|
- li = that._renderItemData( ul, item );
|
|
|
- if ( item.category ) {
|
|
|
- li.attr( "aria-label", item.category + " : " + item.label );
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
if($("input[complete]").length)
|
|
|
{
|
|
|
$("input[complete]").each(function()
|
|
|
{
|
|
|
var cache = {};
|
|
|
var self = $(this);
|
|
|
- //autocomplete
|
|
|
- self.catcomplete(
|
|
|
+ self.autocomplete(
|
|
|
{
|
|
|
minLength: 2,
|
|
|
source: function( request, response )
|
|
@@ -901,6 +877,42 @@ function autocomplete_del(e, id, value)
|
|
|
autocomplete_value.remove(value);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+function searchbox(e)
|
|
|
+{
|
|
|
+ var self = e.prev("input");
|
|
|
+ var v = self.val();
|
|
|
+
|
|
|
+ var html = '<a href="">test</a>';
|
|
|
+ var config = {
|
|
|
+ type: 0,
|
|
|
+ shade: 0,
|
|
|
+ shadeClose : true,
|
|
|
+ content: html
|
|
|
+ };
|
|
|
+
|
|
|
+ config.area = '500px';
|
|
|
+ layer.open(config);
|
|
|
+
|
|
|
+
|
|
|
+ var request = {};
|
|
|
+ request.term = v;
|
|
|
+
|
|
|
+ var cate = self.attr('searchbox_cate');
|
|
|
+ if (cate) {
|
|
|
+ request[cate] = $('update_' + cate + '_value').val();
|
|
|
+ }
|
|
|
+ $.getJSON(self.attr('searchbox') + '&callback=?', request, function( data, status, xhr ) {
|
|
|
+ console.log(data);
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+function searchbox_del(e, id, value)
|
|
|
+{
|
|
|
+ e.parent().parent().remove();
|
|
|
+ searchbox_value.remove(value);
|
|
|
+}
|
|
|
+
|
|
|
//后台通用的提示
|
|
|
function msg(value)
|
|
|
{
|
|
@@ -2019,6 +2031,10 @@ var dever_update =
|
|
|
|
|
|
p.append(content);
|
|
|
|
|
|
+ if ($("#" + id).find('.ke-container').length >= 1) {
|
|
|
+ $("#" + id).find('.ke-container').eq(0).remove();
|
|
|
+ }
|
|
|
+
|
|
|
$('#update_' + key +'_c_' + (self.index[key]-1) + '_i_' + 'order_value').val(parseInt($('#update_' + key +'_c_' + (self.index[key]-2) + '_i_' + 'order_value').val())+1);
|
|
|
|
|
|
self.del();
|