add printer brand and api and type
This commit is contained in:
@@ -12,6 +12,8 @@
|
||||
<%= f.input :template %>
|
||||
<%= f.input :font %>
|
||||
<%= f.input :printer_name, :as => :select, :collection => Printer::PrinterWorker.printers, include_blank: false %>
|
||||
<%= f.input :brand_name %>
|
||||
<%= f.input :printer_type %>
|
||||
<%= f.input :api_settings %>
|
||||
<%= f.input :page_width %>
|
||||
<%= f.input :page_height %>
|
||||
@@ -61,6 +63,22 @@
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
|
||||
// if selected printer change call and bind
|
||||
$("#print_setting_printer_name").on("change", function(){
|
||||
var printer_name = $(this).val();
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: "/get_printer_options/"+printer_name,
|
||||
success:function(result){
|
||||
$("#print_setting_brand_name").val(result.model);
|
||||
$("#print_setting_api_settings").val(result.url);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
function isNumberKey(evt) {
|
||||
var charCode = (evt.which) ? evt.which : event.keyCode;
|
||||
if (charCode != 46 && charCode > 31 && (charCode < 48 || charCode > 57)) {
|
||||
|
||||
Reference in New Issue
Block a user