[OPEN-ILS-DEV] ***SPAM*** Re: ***SPAM*** Using dijit controls in staff client

Bennett Goble bgoble at grpl.org
Tue Jan 31 18:41:21 EST 2012


 >> The data I'm presenting in the control comes from the user settings
 >> table, so I don't think the existing field mapper infrastructure can be
 >> used to dynamically create an appropriate widget.

I have added several ComboBoxes to the user editor with minor changes to 
the existing methodology. To keep the template clean I added 'combodata' 
attribute to field-mapped tags, which register.js uses to select what 
data to use to populate a store (In my case I'm using JS objects in a 
separate file.) This technique could be adapted to use with 
FilteringSelects as well.

https://github.com/grpl-eg/rel_2_1/commit/e0feae00096f99793c1ef6386d770e49f0f6641f

Specifying a combo-box and data source in register_template.tt2:
<tr fmclass='au' fmfield='field_name' combodata='data_name'/>

Probably not the best way to load ad hoc options, and you would need to 
to correct AutoFieldWidget.js' presumption that any field with a store 
is a ComboBox. However, looking over the additions may be helpful if you 
are interested in adding functionality to the existing HTML template and 
AutoFieldWidget based construction method.


Bennett Goble
Network Support Technician
Grand Rapids Public Library

On 01/31/2012 04:40 PM, Scott Prater wrote:
> Hello, Robert --
>
> Take a look at the way the FilteringSelect is used for survey
> questions, lower down in the register.js file.  You can also see a
> mostly working (though there's a bug I need to fix) implementation in
> that same file here:
>
> https://github.com/sprater/Evergreen/commit/f3ecb0a536570e30f27b3ca5604ec476c8b71381
>
> Depending on what you want to do, changes to register_table.tt2 should
> be very minimal;  almost all the heavy lifting isa done in
> register.js.  Again, look at the survey questions HTML for clues
> (though I should point out that the survey questions form elements are
> also moderately broken).
>
> -- Scott
>
> On Tue, Jan 31, 2012 at 2:49 PM,<rwalsh at excalibur-solutions.com>  wrote:
>> Hi all,
>>
>> I'm struggling to add a simple drop-down to the register_table.tt2 page
>> in the staff client. I have things working properly (the correct data is
>> shown and updates are saved) with a basic HTML SELECT control, but to
>> match the look-and-feel of the page I think I need to use either a
>> dijit.form.FilteringSelect or a dijit.form.Select. I can get
>> dijit.form.FilteringSelect to display, but the first reference to the
>> control in the javascript code (in register.js) seems to halt further
>> script processing. I've tried creating the widget programmatically and
>> adding it to the DOM, and I've tried to create the control in the HTML
>> code (with and without an explicitly created analog in javascript). The
>> results so far are always the same - the page simply stops loading
>> either right before or right after my drop-down is displayed, depending
>> on which approach I take.
>>
>> The data I'm presenting in the control comes from the user settings
>> table, so I don't think the existing field mapper infrastructure can be
>> used to dynamically create an appropriate widget.
>>
>> Thanks for any guidance that might point me in the right direction.
>>
>> Robert Walsh
>> Owner / Senior Consultant
>> Excalibur Solutions, Inc.
>> http://www.excalibur-solutions.com
>>
>>


More information about the Open-ils-dev mailing list