[Dojo-interest] Re: Combobox refresh (Garth Brown)
Garth Brown
garthbrown at hotmail.com
Fri Feb 23 13:51:59 MST 2007
I assume you are dynamically building the list of options (for the second
box) based on what is selected in the first box. This is how I got it
working.
*** JS start ***
function changeComboUrlValue(widgetTargetId,widgetSource)
{
var wTarget=dojo.widget.getWidgetById(widgetTargetId);
wTarget.dataUrl =
"mydynamiccombobox.asp?id="+dojo.widget.getWidgetById('foobar1').getValue();
dojo.io.bind(
{
url: wTarget.dataUrl,
load: function(type, data, evt)
{
if(type=="load")
{
if(!dojo.lang.isArray(data))
{
var arrData = [];
for(var key in data)
{
arrData.push([data[key], key]);
}
data = arrData;
}
wTarget.dataProvider.setData(data);
}
},
mimetype: "text/json"
});
}
*** JS End ***
<body>
<select dojoType="select" value="this should never be seen - it is
replaced!" class="dropDownOption" dataUrl="myStaticComboBox.asp"
name="foobar1" id="foobar1" maxListLength="15"
onValueChanged="changeComboUrlValue('foobar2',this);">
</select>
<select dojoType="select" value="this should never be seen - it is
replaced!" class="dropDownOption" dataUrl="" name="foobar2" id="foobar2"
maxListLength="15">
</select>
</body>
******
I hope this helps.
~ Garth
>From: dojo-interest-request at dojotoolkit.org
>Reply-To: dojo-interest at dojotoolkit.org
>To: dojo-interest at dojotoolkit.org
>Subject: Dojo-interest Digest, Vol 26, Issue 119
>Date: Fri, 23 Feb 2007 12:00:04 -0700 (MST)
>
>Send Dojo-interest mailing list submissions to
> dojo-interest at dojotoolkit.org
>
>To subscribe or unsubscribe via the World Wide Web, visit
> http://dojotoolkit.org/mailman/listinfo/dojo-interest
>or, via email, send a message with subject or body 'help' to
> dojo-interest-request at dojotoolkit.org
>
>You can reach the person managing the list at
> dojo-interest-owner at dojotoolkit.org
>
>When replying, please edit your Subject line so it is more specific
>than "Re: Contents of Dojo-interest digest..."
>
>
>Today's Topics:
>
> 1. Re: Combobox refresh (C Sawyer)
> 2. Re: FilteringTable: bug, feature suggestion (C Sawyer)
> 3. Re: test_FilteringTable.html How can i change style?
> (James R. Leu)
>
>
>----------------------------------------------------------------------
>
>Message: 1
>Date: Fri, 23 Feb 2007 10:36:53 -0800
>From: "C Sawyer" <csawyer at yumaed.org>
>Subject: Re: [Dojo-interest] Combobox refresh
>To: dojo-interest at dojotoolkit.org
>Message-ID:
> <5c861a710702231036w436d46d5g9368de963f915345 at mail.gmail.com>
>Content-Type: text/plain; charset="iso-8859-1"
>
>you might have to add that yourself to ComboBox.js
>
>I have a patch in that lets you throw data at it directly(instead of a
>dataUrl). If you have to do it AFTER creation tho, then for now you could
>delete and re-create the widget.
>
>I think refreshing wouldn't be terribly hard, mayby just replace the
>dojo.widget.ComboBoxDataProvider.
>
>Hope this helps!
>
>On 2/23/07, Rene A. Krywult <rene.krywult at gmx.at> wrote:
> >
> > I want to programmatically change the dataUrl of a combobox at runtime (
> > i.e. I need a Double Combox). Well, changing was quite easy (
> > combobox.dataUrl="new Url"), but it didn't refresh automatically.
> >
> > Is there an other way to do this change? If not, is there a way to
>refresh
> > the combobox after the change?
> >
> > Thanks
> >
> > Rene
> > --
> > "Feel free" - 10 GB Mailbox, 100 FreeSMS/Monat ...
> > Jetzt GMX TopMail testen: www.gmx.net/de/go/mailfooter/topmail-out
> > _______________________________________________
> > Dojo FAQ: http://dojo.jot.com/FAQ
> > Dojo Book: http://manual.dojotoolkit.org/DojoDotBook
> > Dojo-interest at dojotoolkit.org
> > http://dojotoolkit.org/mailman/listinfo/dojo-interest
> >
> >
>-------------- next part --------------
>An HTML attachment was scrubbed...
>URL:
>http://dojotoolkit.org/pipermail/dojo-interest/attachments/20070223/55d9f314/attachment-0001.html
>
>------------------------------
>
>Message: 2
>Date: Fri, 23 Feb 2007 10:48:38 -0800
>From: "C Sawyer" <csawyer at yumaed.org>
>Subject: Re: [Dojo-interest] FilteringTable: bug, feature suggestion
>To: dojo-interest at dojotoolkit.org
>Message-ID:
> <5c861a710702231048t3d3ddf4cn903694f1c517cf80 at mail.gmail.com>
>Content-Type: text/plain; charset="iso-8859-1"
>
>Hi Tom.
>
>I'm working on Table widgets, which may not be the same as your grid
>Widget.
>
>This is an old version of what I'm doing:
> http://www.yuma.ca/tech/js/testcpTable.html
>
>I'm not sure how far along you are with the grid code, and exactly what it
>is, but if they are approaching the same thing, it's better for both of us
>if we don't clobber each other's work.
>
>My new versions are 3 widgets:
> Table (the core widget)
> EditableWidget
> -- allows inline editing, deleting, etc basically what the test above
>does.
> CheckboxWidget
> -- this will have a checkbox column to select many and then perform
>actions on them.
>
>None of what I'm doing will have client side filtering/etc at this time as
>I
>currently have no need for that.
>
>I have a ccla on file (Yuma Union High School District), if you care.
>
>Hope this helps!
>
>
>
>On 2/23/07, Tom Trenka <dojo-interest at dept-z.com> wrote:
> >
> >
> > I didn't say it's not demanded; I just said that it will be a bit before
> > it's
> > implemented (if at all; we're starting to work on a real grid widget in
> > response to a number of requests, including yours).
> >
> > Timing is an issue more than anything else; you guys are asking for
>these
> > things just when we're about to do major breaking changes, and all of
>our
> > time is somewhat limited.
> >
> > There's a bug in the current rev that I have yet to fix, yes; I'll
> > probably
> > be fixing it this weekend. Has to do with matching updated objects that
> > are
> > being swapped. A bug report is already filed for it.
> >
> > trt
> >
> >
> > Sasha Firsov wrote:
> > >
> > > Welcome to the club :)
> > > There are several patches with a same goal: customize
> > > rendering(formatting), sorting and filtering.
> > > Tom, you still think the generic one is not demanded?
> > >
> > > Sasha
> > > PS see DateFill and LabelFill functions in
> > >
> >
>http://firsov.net/~suns/demos/dojo/FilteringTable_fillCell/dojo-base/tests/widget/test_FilteringTable_fillCell.html
> > >
> > > Mark Williams wrote:
> > >> There appears to be a bug in initialize() at line 925 (revision
>7337):
> > >>
> > >> var oldRow =
> > >> self.getRow(self.store.getDataByKey(updatedObject[self.store.keyField
> > ]));
> > >>
> > >> I think this should be:
> > >>
> > >> var oldRow =
> > >> self.getRow(self.store.getDataByKey(updatedObject.src[
> > self.store.keyField]));
> > >>
> > >> A feature I think would be useful for FilteringTable is the ability
>to
> > >> specify a formatting function for a column. The ability to have
> > >> computed columns is nice, but using a computed column breaks the
> > natural
> > >> association between its underlying value (it often has just one) and
> > the
> > >> corresponding data record field. The most inconvenient effect of
>this
> > >> is to mess up sorting. A frequent use of this feature might be to
> > >> display the column value as a link (especially useful for primary
> > keys),
> > >> or as a way to display numbers in various formats, or to make other
> > >> visual changes that you want to have no effect on sorting.
> > >>
> > >> Here's my own rudimentary implementation of this:
> > >>
> > >> dojo.widget.defineWidget(
> > >> "my.widget.Filteringtable",
> > >> dojo.widget.FilteringTable,
> > >> {
> > >> parseMetadata: function(/* HTMLTableHead */head){
> > >>
> > >> my.widget.Filteringtable.superclass.parseMetadata.apply
> > (this,arguments);
> > >>
> > >> for ( var c = 0; c < this.columns.length; c++ ) {
> > >> var col = this.columns[c];
> > >> if ( col.format ) {
> > >> var f = this.getTypeFromString(col.format);
> > >> if (f != null && f != window &&
> > >> typeof(f)=="function"){
> > >> col.formatFunction=f;
> > >> }
> > >> }
> > >> }
> > >> },
> > >>
> > >> fillCell: function(/* HTMLTableCell */cell, /* object */meta,
> > /*
> > >> object */val){
> > >> if ( meta.formatFunction ) {
> > >> cell.innerHTML = meta.formatFunction(val);
> > >> } else {
> > >>
> > >> my.widget.Filteringtable.superclass.fillCell.apply(this,arguments);
> > >> }
> > >> }
> > >> }
> > >> )
> > >>
> > >>
> > >>
> > >>
> > >>
> > >>
> > ------------------------------------------------------------------------
> > >> 8:00? 8:25? 8:40? Find a flick <
> > >> http://tools.search.yahoo.com/shortcuts/?fr=oni_on_mail&#news> in no
> > time
> > >> with theYahoo! Search movie showtime shortcut. <
> > >> http://tools.search.yahoo.com/shortcuts/?fr=oni_on_mail&#news>
> > >>
> > >>
> > >>
> > ------------------------------------------------------------------------
> > >>
> > >> _______________________________________________
> > >> Dojo FAQ: http://dojo.jot.com/FAQ
> > >> Dojo Book: http://manual.dojotoolkit.org/DojoDotBook
> > >> Dojo-interest at dojotoolkit.org
> > >> http://dojotoolkit.org/mailman/listinfo/dojo-interest
> > >
> > > _______________________________________________
> > > Dojo FAQ: http://dojo.jot.com/FAQ
> > > Dojo Book: http://manual.dojotoolkit.org/DojoDotBook
> > > Dojo-interest at dojotoolkit.org
> > > http://dojotoolkit.org/mailman/listinfo/dojo-interest
> > >
> > >
> >
> > --
> > View this message in context:
> >
>http://www.nabble.com/FilteringTable%3A-bug%2C-feature-suggestion-tf3276823.html#a9122078
> > Sent from the Dojo mailing list archive at Nabble.com.
> >
> > _______________________________________________
> > Dojo FAQ: http://dojo.jot.com/FAQ
> > Dojo Book: http://manual.dojotoolkit.org/DojoDotBook
> > Dojo-interest at dojotoolkit.org
> > http://dojotoolkit.org/mailman/listinfo/dojo-interest
> >
> >
>-------------- next part --------------
>An HTML attachment was scrubbed...
>URL:
>http://dojotoolkit.org/pipermail/dojo-interest/attachments/20070223/18e8eeff/attachment-0001.html
>
>------------------------------
>
>Message: 3
>Date: Fri, 23 Feb 2007 12:55:06 -0600
>From: "James R. Leu" <jleu at mindspring.com>
>Subject: Re: [Dojo-interest] test_FilteringTable.html How can i change
> style?
>To: dojo-interest at dojotoolkit.org
>Message-ID: <20070223185506.GB27659 at mindspring.com>
>Content-Type: text/plain; charset="us-ascii"
>
>I just got done figuring this out! Here is my example which implements
>the standard dojo style, but by uses the class from the encapsulating div.
>I've been unable to get the scrolling tbody to work though and I've
>stripped the IE specific stuff at this time. If anyone see problems with
>my CSS, please let me know.
>
> <style type="text/css">
> .filterTableContainer {
> overflow-y: auto;
> }
>
> .filterTableContainer table {
> border:1px solid #ccc;
> width:100%;
> cursor:default;
> }
>
> .filterTableContainer table thead td,
> .filterTableContainer table thead th {
> background-image:url([%
>Catalyst.uri_for('/static/images/ft-head.gif') -%]);
> background-repeat:no-repeat;
> background-position:top right;
> }
>
> .filterTableContainer table td,
> .filterTableContainer table th {
> border-right:1px solid #999;
> padding:2px;
> font-weight:normal;
> }
>
> .filterTableContainer table thead .selectedUp {
> background-image: url([%
>Catalyst.uri_for('/static/images/ft-headup.gif') -%]);
> }
>
> .filterTableContainer table thead .selectedDown {
> background-image: url([%
>Catalyst.uri_for('/static/images/ft-headdown.gif') -%]);
> }
>
> .filterTableContainer tbody.filterTableScrollContent tr td {
> background: #FFF;
> }
>
> .filterTableContainer tbody.filterTableScrollContent
>tr.filterTableAlternateRow td {
> background: #e3edfa;
> }
>
> .filterTableContainer tbody.filterTableScrollContent tr.selected td {
> background: yellow;
> }
>
> .filterTableContainer tbody.filterTableScrollContent tr:hover td {
> background: #a6c2e7;
> }
>
> .filterTableContainer tbody.filterTableScrollContent tr.selected:hover
>td {
> background: #ff3;
> }
>
> </style>
>
> <div id="fooFilterTableContainer" class="filterTableContainer">
> <table dojoType="FilteringTable" widgetId="fooTable"
> headClass="filterTableFixedHeader"
>tbodyClass="filterTableScrollContent"
> multiple="false" alternateRows="true"
> rowAlternateClass="filterTableAlternateRow" cellpadding="0"
> cellspacing="0" border="0">
> <thead>
> <tr>
> <th field="foo1" dataType="String">Foo</th>
> <th field="foo2" dataType="String">Foo</th>
> <th field="foo3" dataType="String">Foo</th>
> <th field="foo4" dataType="String">Foo</th>
> <th field="foo5" dataType="String">Foo</th>
> <th field="foo6" dataType="String">Foo</th>
> <th field="foo7" dataType="String">Foo</th>
> <th field="foo8" dataType="String">Foo</th>
> </tr>
> </thead>
> <tbody>
> [% FOREACH widget IN widgets -%]
> [% widget.result -%]
> [% END -%]
> </tbody>
> </table>
> </div>
>
>
>On Fri, Feb 23, 2007 at 05:07:56PM +0100, Giuseppe Cassata wrote:
> > The style of the example is very poor....
> >
> > How can I change it?
> >
> > I tried to set the css class this way
> >
> > filteringTable.domNode.className="dojoFilteringTable";
> >
> > and also
> >
> > filteringTable.templateCssPath:
>dojo.uri.dojoUri("src/widget/templates/GCFilteringTable.css")
> >
> >
> > but nothing happens.......
> >
> > Where dojoFilteringTable is a class I made...
> > but nothing happens.....
> >
> > How Can I Do it?
> > Thank you very much
> >
> > Giuseppe Cassata
> > _______________________________________________
> > Dojo FAQ: http://dojo.jot.com/FAQ
> > Dojo Book: http://manual.dojotoolkit.org/DojoDotBook
> > Dojo-interest at dojotoolkit.org
> > http://dojotoolkit.org/mailman/listinfo/dojo-interest
>
>
>--
>James R. Leu
>jleu at mindspring.com
>-------------- next part --------------
>A non-text attachment was scrubbed...
>Name: not available
>Type: application/pgp-signature
>Size: 189 bytes
>Desc: not available
>Url :
>http://dojotoolkit.org/pipermail/dojo-interest/attachments/20070223/18d7aed3/attachment-0001.pgp
>
>------------------------------
>
>_______________________________________________
>Dojo-interest mailing list
>Dojo-interest at dojotoolkit.org
>http://dojotoolkit.org/mailman/listinfo/dojo-interest
>
>
>End of Dojo-interest Digest, Vol 26, Issue 119
>**********************************************
More information about the Dojo-interest
mailing list