$(document).ready(function(){
//----------------------------------------
// Django Library Page CSS Fix
- /*var fix_library_css = function() {
- Ext.fly('library-index-div').select('*').addClass('djangocss');
+ var fix_library_css = function() {
+ var tofix = Ext.fly('library-index-div');
+ if (tofix != null)
+ {
+ tofix.select('*').addClass('djangocss');
+ }
}
fix_library_css();
- */
//----------------------------------------
items: create_dynamic_panels().concat([panel_bcmagic])
});
+
+
+ //-------------------------------
+ // East Region Setup
+ //-------------------------------
var get_east_panel_content = function(){
// East panel contentEl id is supplied in html div id of east_region_config.
var east_id = Ext.fly('east_region_config').dom.textContent;
+ // Length of zero is a valid response... also happens to return null in next
+ // if statement if not handled before hand.
+ if (east_id.length == 0){
+ return east_id;
+ }
+
// If no element exists with the supplied content id, report and error.
if (Ext.fly(east_id) == null){
return 'east_region_config_error';
}
+
return east_id;
}
height: 30
//margins: '2 0 0 0'
}],
- height: 90
+ height: 90,
+ collapsible: true,
+ collapseMode: 'mini',
+ split: true
},menuPanel,{
//title: 'Body',
region: 'center',
xtype: 'panel',
//autoScroll: true,
layout: 'fit',
- margins: '2 2 2 0',
+ margins: '2 0 2 0',
items: [{
//title: 'Inner Panel',
contentEl: 'body_content',
// Shifts the remaining toolbar options to the right side.
main_tb.add({ xtype: 'tbfill' });
+
+ //----------------------------------------
+ // ExtJS Barcode Magic Implementation
+ var bcmagic_ext_keyhandler = function(sObj, e){
+ //Process upon enter key as input.
+ if (e.getKey() == e.ENTER)
+ bcmagic_process();
+ }
+
+ var bcmagic_input = new Ext.form.TextField({
+ id: 'bcmagic_input_field',
+ emptyText: 'barcode magic'
+ });
+ bcmagic_input.on('specialkey', bcmagic_ext_keyhandler);
+
+ main_tb.add(bcmagic_input);
+ //--------------------------------------
+
var user_info = Ext.fly('login_info');
var logout_url = user_info.getAttribute('logouturl');
var login_url = user_info.getAttribute('loginurl');
add_buttons_from_html(app_tb, 'app_toolbar_east');
app_tb.doLayout();
+ // Focus on barcode magic, because it's awesome and needs attention! ;-)
+ bcmagic_input.focus();
+ // FIXME: grid target temp code.
+ var grid_target = Ext.fly('grid_target');
+ if (grid_target != null){
+ var grid = getInventoryDataGrid();
+ grid.render(grid_target);
+ }
});
\ No newline at end of file