form bugfix and otehr minor fixes

This commit is contained in:
Rushabh Mehta
2012-02-20 12:35:23 +05:30
parent e08b9425cb
commit 13531b73eb
7 changed files with 47 additions and 17 deletions

View File

@@ -39,14 +39,14 @@ header .topbar .container {
margin: auto;
}
.web-head-section {
margin-bottom: 20px
}
.web-content input[type="text"], .web-content input[type="password"], .web-content select {
min-width: 180px;
}
.web-head-section {
margin-bottom: 20px
}
.web-main-section {
width: 65%;
float: left;

View File

@@ -0,0 +1,28 @@
// update parent select
$.extend(cur_frm.cscript, {
onload_post_render: function(doc) {
// get labels of parent items
var get_parent_options = function(table_field) {
var items = getchildren('Top Bar Item', doc.name, table_field);
var main_items = [''];
for(var i in items) {
var d = items[i];
if(!d.parent_label) {
main_items.push(d.label);
}
}
return main_items.join('\n');
}
// bind function to refresh fields
// when "Parent Label" is select, it
// should automatically update
// options
$(cur_frm.fields_dict['top_bar_items'].grid.get_field('parent_label').wrapper)
.bind('refresh', function() {
this.fieldobj.refresh_options(get_parent_options('top_bar_items'));
});
}
});