EasyUI Forum
May 14, 2024, 03:10:42 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Printing jeasyui dialog form with data  (Read 8176 times)
stephenl
Newbie
*
Posts: 30


View Profile
« on: October 19, 2014, 06:45:40 AM »

I am trying to print a jeasyui dialog form using the following method

The form layout shows correctly, however the values don't apear within the form. I have checked the HTML code from the new window, and all "values" are present, however they appear as type="hidden" , is this why they arn't showing ??

function printFORM()
 {
  var content = $('#dlg').dialog('dialog');
  var FPrint = window.open('', '', 'letf=100,top=100,width=600,height=600');

  FPrint.document.write(content[0].innerHTML);
  FPrint.document.close();
  FPrint.focus();
  FPrint.print();
  FPrint.close()   
 }

Sample new window form, HTML Code: <input value="103" name="id" class="textbox-value" type="hidden">

Any suggestions or pointers would be appreciated.
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: October 19, 2014, 07:41:07 AM »

Please try to override the 'setText' method of textbox.
Code:
(function($){
var setText = $.fn.textbox.methods.setText;
$.fn.textbox.methods.setText = function(jq, text){
return jq.each(function(){
$(this).textbox('textbox').attr('value', text);
setText.call($.fn.textbox.methods, $(this), text);
})
}
})(jQuery);
Logged
stephenl
Newbie
*
Posts: 30


View Profile
« Reply #2 on: October 19, 2014, 09:02:04 AM »

Hi

Thanks for your suggestion, this partially works..

The Form also has Multiline text areas, and Radio Buttons, these are still not showing

The HTML from the Multiline text areas withn the new opened window is as follows :-

<input textboxname="Results" class="easyui-textbox textbox-f" prompt="Results" multiline="true" style="width: 540px; height: 50px; display: none;" required="true"> <span style="width: 538px; height: 48px;" class="textbox"> <textarea value="Multiline of Text" style="margin-left: 0px; margin-right: 0px; height: 40px; width: 530px;" placeholder="Results"  class="textbox-text validatebox-text" autocomplete="off"></textarea> <input value="Multiline of Text" name="Results" class="textbox-value" type="hidden"></span></td>

Do you have a suggestion ?
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #3 on: October 19, 2014, 05:52:21 PM »

Please try the updated code.
Code:
(function($){
var setText = $.fn.textbox.methods.setText;
$.fn.textbox.methods.setText = function(jq, text){
return jq.each(function(){
var tb = $(this).textbox('textbox');
tb.attr('value', text);
if (tb[0].tagName == 'TEXTAREA'){
tb.html(text);
}
setText.call($.fn.textbox.methods, $(this), text);
})
}
})(jQuery);
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!