Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // for image from attachment
- // takes the selected image and creates
- // a table with image in HTML
- // in the "ref_image" field
- console.log (" Custom code working fine ")
- cur_frm.cscript.add_new_image = function(doc, cdt, cdn) {
- var d = locals[cdt][cdn];
- if(!d.new_image) {
- msgprint(wn._('Please select an "Image" first'));
- return;
- }
- d.description = repl('<table style="width: 100%; table-layout: fixed;">'+
- '<tr><td style="width:110px"><img src="%(imgurl)s" width="100px"></td>'+
- '<td>%(desc)s<td/><tr/>'+
- '</table>', {imgurl: wn.utils.get_file_link(d.new_image), desc:d.description});
- refresh_field('d.description');
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement