Merge branch 'handlerupdate' of github.com:webnotes/wnframework into handlerupdate
This commit is contained in:
commit
ec0b4f8fdb
4 changed files with 29 additions and 20 deletions
|
|
@ -21,6 +21,11 @@ div.list-row:hover {
|
|||
background-color: #eef
|
||||
}
|
||||
|
||||
div.paging-button {
|
||||
text-align: center;
|
||||
padding: 11px 0px;
|
||||
}
|
||||
|
||||
div.show_filters {
|
||||
display: none;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ search_fields = {};
|
|||
|
||||
function setlinkvalue(name) {
|
||||
//selector.input.set(name);// in local - this will be set onchange
|
||||
selector.input.set_input(name); // on screen
|
||||
selector.input.set_input_value(name); // on screen
|
||||
selector.hide();
|
||||
}
|
||||
|
||||
|
|
@ -130,8 +130,8 @@ function makeselector() {
|
|||
}
|
||||
}
|
||||
d.onhide = function() {
|
||||
if(d.input && d.input.txt) // link, call onchange
|
||||
d.input.txt.onchange()
|
||||
//if(d.input && d.input.txt) // link, call onchange
|
||||
// d.input.txt.set_input_value()
|
||||
}
|
||||
|
||||
btn.onclick = function() {
|
||||
|
|
@ -191,10 +191,15 @@ function makeselector() {
|
|||
|
||||
var w = $a(d.rows['Result'],'div','',{height:'240px',overflow:'auto',margin:'4px'});
|
||||
for(var i=0; i<r.values.length; i++) {
|
||||
var div = $a(w,'div','',{marginBottom:'4px',paddingBottom:'4px',borderBottom:'1px dashed #CCC'});
|
||||
var div = $a(w,'div','',
|
||||
{marginBottom:'4px',paddingBottom:'4px',borderBottom:'1px dashed #CCC'});
|
||||
|
||||
// link
|
||||
var l = $a($a(div,'div'),'span','link_type'); l.innerHTML = r.values[i][0]; l.link_name = r.values[i][0]; l.dt = r.coloptions[0];
|
||||
var l = $a($a(div,'div'),'span','link_type');
|
||||
l.innerHTML = r.values[i][0];
|
||||
l.link_name = r.values[i][0];
|
||||
l.dt = r.coloptions[0];
|
||||
|
||||
if(d.input)
|
||||
l.onclick = function() { setlinkvalue(this.link_name); }
|
||||
else
|
||||
|
|
|
|||
|
|
@ -408,6 +408,11 @@ DataField.prototype.make_input = function() {
|
|||
}
|
||||
|
||||
this.input.name = this.df.fieldname;
|
||||
|
||||
$(this.input).change(function() {
|
||||
me.set_value($(this).val());
|
||||
});
|
||||
|
||||
this.set_value = function(val) {
|
||||
if(!me.last_value)me.last_value='';
|
||||
|
||||
|
|
@ -457,7 +462,7 @@ DataField.prototype.make_input = function() {
|
|||
});
|
||||
},
|
||||
select: function(event, ui) {
|
||||
me.set_value(ui.item.value);
|
||||
me.set_input_value(ui.item.value);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
|
@ -753,12 +758,6 @@ LinkField.prototype.set_input_value = function(val) {
|
|||
);
|
||||
}
|
||||
|
||||
LinkField.prototype.set_onchange = function() {
|
||||
var me = this;
|
||||
$(me.txt).change(function(event) {
|
||||
|
||||
});
|
||||
}
|
||||
LinkField.prototype.set_fetch_values = function(fetch_values) {
|
||||
var fl = cur_frm.fetch_dict[this.df.fieldname].fields;
|
||||
var changed_fields = [];
|
||||
|
|
|
|||
|
|
@ -111,11 +111,11 @@ wn.ui.Listing = Class.extend({
|
|||
\
|
||||
<div class="result">\
|
||||
<div class="result-list"></div>\
|
||||
<div class="result-grid"></div>\
|
||||
<div class="result-grid hide"></div>\
|
||||
</div>\
|
||||
\
|
||||
<div class="paging-button hide">\
|
||||
<button class="btn btn-small btn-more">More...</div>\
|
||||
<div class="paging-button">\
|
||||
<button class="btn btn-small btn-more hide">More...</div>\
|
||||
</div>\
|
||||
</div>\
|
||||
', this.opts));
|
||||
|
|
@ -168,17 +168,17 @@ wn.ui.Listing = Class.extend({
|
|||
newdoc(me.new_doctype);
|
||||
})
|
||||
} else {
|
||||
this.$w.find('.btn-new').toggle(false).attr('hidden', 'true');
|
||||
this.$w.find('.btn-new').toggle(false).attr('hidden', 'hidden');
|
||||
}
|
||||
|
||||
// hide-filter
|
||||
if(!me.show_filters) {
|
||||
this.$w.find('.btn-filter').toggle(false).attr('hidden', 'true');
|
||||
this.$w.find('.btn-filter').toggle(false).attr('hidden', 'hidden');
|
||||
}
|
||||
|
||||
// hide-refresh
|
||||
if(this.hide_refresh || this.no_refresh) {
|
||||
this.$w.find('.btn-refresh').toggle(false).attr('hidden', 'true');
|
||||
this.$w.find('.btn-refresh').toggle(false).attr('hidden', 'hidden');
|
||||
}
|
||||
|
||||
// toggle-view
|
||||
|
|
@ -187,7 +187,7 @@ wn.ui.Listing = Class.extend({
|
|||
}
|
||||
|
||||
// btn group only if more than 1 button
|
||||
if(this.$w.find('.list-toolbar [hidden!="true"]').length>1) {
|
||||
if(this.$w.find('.list-toolbar a[hidden!="hidden"]').length>1) {
|
||||
this.$w.find('.list-toolbar').addClass('btn-group')
|
||||
}
|
||||
},
|
||||
|
|
@ -216,7 +216,7 @@ wn.ui.Listing = Class.extend({
|
|||
this.onrun = a0;
|
||||
if(a0 && a0.callback)
|
||||
this.onrun = a0.callback;
|
||||
if(!a1 || (a0 && a0.append))
|
||||
if(!a1 && !(a0 && a0.append))
|
||||
this.start = 0;
|
||||
|
||||
me.$w.find('.img-load').toggle(true);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue