Skip to search.

Breaking News Visit Yahoo! News for the latest.

×Close this window

ydn-javascript · Yahoo! User Interface Library Group

The Yahoo! Groups Product Blog

Check it out!

Group Information

  • Members: 12937
  • Category: JavaScript
  • Founded: Dec 15, 2005
  • Language: English
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

Messages

Advanced
Messages Help
Messages 17568 - 17599 of 52481   Oldest  |  < Older  |  Newer >  |  Newest
Messages: Show Message Summaries Sort by Date ^  
#17568 From: Rodrigo Haas <rodrigohaasbrasil@...>
Date: Sat Sep 1, 2007 5:01 am
Subject: data table formatLink problem
rodrigohaasb...
Send Email Send Email
 
Hi all!

When show query results in DataTable with "Row Selection" the cells with "Link Format" (formatter:YAHOO.widget.DataTable.formatLink) don't execute the links!

How can fix this problem?

Thanks a lot!


Rodrigo Haas

 

Flickr agora em português. Você clica, todo mundo vê. Saiba mais.


#17569 From: "Satyam" <satyam@...>
Date: Sat Sep 1, 2007 8:12 am
Subject: Re: data table formatLink problem
satyamutsa
Send Email Send Email
 
I remember that links didn't work in some old version of YUI, 2.1 or before.  They were fixed, or so I recall, I didn't test them myself, in 2.2 or thereabouts.
 
Satyam
 
----- Original Message -----
Sent: Saturday, September 01, 2007 7:01 AM
Subject: [ydn-javascript] data table formatLink problem

Hi all!

When show query results in DataTable with "Row Selection" the cells with "Link Format" (formatter:YAHOO.widget.DataTable.formatLink) don't execute the links!

How can fix this problem?

Thanks a lot!


Rodrigo Haas

 

Flickr agora em português. Você clica, todo mundo vê. Saiba mais.


No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.484 / Virus Database: 269.13.1/982 - Release Date: 31/08/2007 17:21

#17571 From: Alex Leonard <alexleonard2003@...>
Date: Sat Sep 1, 2007 10:07 am
Subject: Re: Menus, XHTML and non validity
alexleonard2006
Send Email Send Email
 
Brilliant.. I completely forgot about CDATA stuff - it's just something I've read about but never actually needed to use. Thanks.

I haven't had time to read through the event sections yet, but ultimately I'd probably prefer to have the javascript external.

Cheers dude.
Alex

Todd Kloots wrote:
Alex -

You'll need to place the script inside a CDATA block in order for it to validate:

<script type="text/javascript">
<![CDATA[

<!-- YOUR JAVASCRIPT HERE -->

]]>
</script>


That said, as you are currently using the "onContentReady" method of the Event utility, there is no reason why you couldn't just take this script (as is) out of the head and place it in an external file.

The Event utility's "onContentReady" method is one of three ways that the YUI Event utility facilitates the style of unobtrusive binding of DOM event handlers as mentioned in the blog entry by Simon Willison that you referenced.  For more on this topic, check out these two sections of the Event Utility's landing page:

http://developer.yahoo.com/yui/event/#onavailable
http://developer.yahoo.com/yui/event/#ondomready

- Todd

Alex Leonard wrote:

Hi there,

I am working on my first use of YUI's menu system and have encountered a
small problem.

As a result of having script items in the <head> I am failing validation.

I was going to go ahead and try and take those elements out of the head
and place them in an external javascript file and use an addLoadEvent
function as recommended by Simon Willison:
http://simonwillison.net/2004/May/26/addLoadEvent/ <http://simonwillison.net/2004/May/26/addLoadEvent/>

However I am unfamiliar with the methods used and thought I would ask
advice first.

The sample page in question is:

http://www.pixelapes.com/devel/coral_leisure/testing/ <http://www.pixelapes.com/devel/coral_leisure/testing/>

and the javascript in the head which seems to be causing a validation
fail is listed below. The validator points specifically at the line "if
(oAnim && oAnim.isAnimated()) {" where it picks up on the usage of the &
symbol as causing an XML parsing error and being the first character of
a delimiter where none exists.

Is there a good way of taking these lines of script out of the head and
replacing them with a short addLoadEvent? Or is this something that they
are already doing? It does feel like these lines would be better off in
an external .js file.

I hope this all makes sense! If I can help explain the problem further,
please let me know.

Kind regards,

Alex Leonard

******* Javascript Code that is causing the problem *************

<script type="text/javascript">
// Initialize and render the menu bar when it is available in the DOM

YAHOO.util.Event.onContentReady("main-nav", function () {
// Animation object
var oAnim;
// "beforeshow" event handler for each submenu of the menu bar
function onMenuBeforeShow(p_sType, p_sArgs) {
var oBody,
oShadow,
oUL;
if (this.parent) {
oShadow = this.element.lastChild;
oShadow.style.height = "0px";
if (oAnim && oAnim.isAnimated()) {
oAnim.stop();
oAnim = null;
}
oBody = this.body;
oUL = oBody.getElementsByTagName("ul")[0];
YAHOO.util.Dom.setStyle(oBody, "overflow", "hidden");
YAHOO.util.Dom.setStyle(oUL, "marginTop", ("-" +
oUL.offsetHeight + "px"));
}
}

function onTween(p_sType, p_aArgs, p_oShadow) {
if (this.cfg.getProperty("iframe")) {
this.syncIframe();
}
if (p_oShadow) {
p_oShadow.style.height = this.element.offsetHeight + "px";
}
}

function onAnimationComplete(p_sType, p_aArgs, p_oShadow) {
var oBody = this.body,
oUL = oBody.getElementsByTagName("ul")[0];
if (p_oShadow) {
p_oShadow.style.height = this.element.offsetHeight + "px";
}
YAHOO.util.Dom.setStyle(oUL, "marginTop", "auto");
YAHOO.util.Dom.setStyle(oBody, "overflow", "visible");
if (YAHOO.env.ua.ie) {
YAHOO.util.Dom.setStyle(oBody, "zoom", "1");
}
}
// "show" event handler for each submenu of the menu bar
function onMenuShow(p_sType, p_sArgs) {
var oElement,
oShadow,
oUL;
if (this.parent) {
oElement = this.element;
oShadow = oElement.lastChild;
oUL = this.body.getElementsByTagName("ul")[0];
oAnim = new YAHOO.util.Anim(oUL,
{ marginTop: { to: 0 } },
.5, YAHOO.util.Easing.easeOut);
oAnim.onStart.subscribe(function () {
oShadow.style.height = "100%";
});
oAnim.animate();
/*
Refire the event handler for the "iframe"
configuration property with each tween so that the
size and position of the iframe shim remain in sync
with the menu.
*/
if (YAHOO.env.ua.ie) {
oShadow.style.height = oElement.offsetHeight + "px";
oAnim.onTween.subscribe(onTween, oShadow, this);
}
oAnim.onComplete.subscribe(onAnimationComplete, oShadow, this);
}
}
// Instantiate and render the menu bar
var oMenuBar = new YAHOO.widget.MenuBar("main-nav", {
autosubmenudisplay: true, hidedelay: 500, lazyload: true });
oMenuBar.subscribe("beforeShow", onMenuBeforeShow);
oMenuBar.subscribe("show", onMenuShow);
/*
Call the "render" method with no arguments since the markup for
this menu already exists in the DOM.
*/
oMenuBar.render();
});

// NUMBER 2

// Initialize and render the menu when it is available in the DOM

YAHOO.util.Event.onContentReady("centres-nav", function () {

/*
Instantiate the menu. The first argument passed to the
constructor is the id of the element in the DOM that
represents the menu; the second is an object literal
representing a set of configuration properties for
the menu.
*/

var oMenu = new YAHOO.widget.Menu("centres-nav", {position:
"static", hidedelay: 500, lazyload: true, effect: {effect:
YAHOO.widget.ContainerEffect.FADE, duration: 0.25} } );

/*
Call the "render" method with no arguments since the markup for
this menu already exists in the DOM.
*/

oMenu.render();

});
</script>




#17572 From: "ter31024" <ter@...>
Date: Sat Sep 1, 2007 7:34 pm
Subject: Links in a DataTable
ter31024
Send Email Send Email
 
Hello,

I'm still fairly new at YUI and am having trouble getting links
configured in a DataTable.  I have added the
'YAHOO.widget.DataTable.formatLink' method as a parameter to my column
definitions and that succeeds in making the cell data equal to the
HREF.  However, what I would like to do is append an 'html' extension
to this.  I.e. the cell data would say "servers" but it would link to
"servers.html"

It seems the only way to do this is to override the formatLink method
and I'm not having much luck with that.  Is there an easier way to do
this?

Any guidance in the right direction would be appreciated.
Tom

#17573 From: "Satyam" <satyam@...>
Date: Sat Sep 1, 2007 8:26 pm
Subject: Re: Links in a DataTable
satyamutsa
Send Email Send Email
 
In the DataSource, you could do:

responseSchema.fields = [ ... , {key:'myLink',parser:function(link) {return
link + '.html'}}, ... ]

or otherwise you could either redefined the formatLink method or define your
own separate function based on formatLink and assign it to formatter.

Satyam

----- Original Message -----
From: "ter31024" <ter@...>
To: <ydn-javascript@yahoogroups.com>
Sent: Saturday, September 01, 2007 9:34 PM
Subject: [ydn-javascript] Links in a DataTable


> Hello,
>
> I'm still fairly new at YUI and am having trouble getting links
> configured in a DataTable.  I have added the
> 'YAHOO.widget.DataTable.formatLink' method as a parameter to my column
> definitions and that succeeds in making the cell data equal to the
> HREF.  However, what I would like to do is append an 'html' extension
> to this.  I.e. the cell data would say "servers" but it would link to
> "servers.html"
>
> It seems the only way to do this is to override the formatLink method
> and I'm not having much luck with that.  Is there an easier way to do
> this?
>
> Any guidance in the right direction would be appreciated.
> Tom
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
> --
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.5.484 / Virus Database: 269.13.1/982 - Release Date: 31/08/2007
> 17:21
>
>

#17574 From: Caridy Patiño Mayea <caridy@...>
Date: Sat Sep 1, 2007 10:09 pm
Subject: Re: Tooltips after 2.3.0 Upgrade
caridyp
Send Email Send Email
 
Hi,

The mark-up of the tooltip control has changed in the YUI 2.3.0,
mainly for the shadow and the rounded corners. That's why you need to
change the CSS's rules.

The new mark-up:

<div class="yui-module yui-overlay yui-tt">
   <div class="bd">text here...</div>
   <div class="yui-tt-shadow yui-tt-shadow-visible"></div>
</div>

The correct CSS rule must be:

.yui-tt .bd {
     color: #000;
     background-color: #FFEE69;
     width: 250px; /* auto by default */
     font-size: 100%;
}

That's all...

Best Regards,
Caridy (caridy at gmail.com)
http://www.bubbling-library.com/


--- In ydn-javascript@yahoogroups.com, "brendangibson"
<brendangibson@...> wrote:
>
> I upgraded our YUI from 2.2.2 to 2.3.0 and noticed that my tooltips no
> longer work as before.
>
> Now the tooltip is so big that it stretches out of the screen and I
> can't see the text.  Previously the tooltip stretched to the size of
> the text within it.
>
> I have tried adding a width attribute to the call, but that sets the
> tooltip to a fixed width, which I don't want.  I have tried values of
> '100%' and 'auto' as well, but they don't do what I want.
>
> From the README:
>
> + YAHOO.widget.Tooltip instances without a value specified for the
> "width"
>   configuration property will be rendered at a width equal to the
> offsetWidth
>   of their root <DIV/> element to prevent their width from being
> clipped or
>   constrained by their parent HTML element.
>
> I don't really understand this bit...
>
> How do I setup my tooltips so that their widths are dependent on their
> contents?
>

#17575 From: Caridy Patiño Mayea <caridy@...>
Date: Sat Sep 1, 2007 10:10 pm
Subject: Re: Tab already exists ... (global unique ID for each tab)
caridyp
Send Email Send Email
 
Hi Prasanna,

Sorry for the delay...

Unfortunately, the tabview/tab control don't have a manager to
interconnect the DOM references with a certain tabview/tab object,
just like the YUI MenuManager control...

Will be great if the YUI's guys include something like this:

YAHOO.widget.TabviewManager.getTab ('mytab1');
YAHOO.widget.TabviewManager.getTabView ('mytabview1');

Don't you think so?

Well, getting back to your problem, You have few possible solutions here:

1. Based on the previous example... just find the position of the LI
with the correct ID (equal to guid), and based on this position, apply
the correct activeIndex  for the tabview.

2. Create a hash table (a literal object) to store the references of
each tab, based on the guid, and then you can use this reference to
activate the tab.

That's all..

Best Regards,
Caridy (caridy at gmail.com)
http://www.bubbling-library.com/


--- In ydn-javascript@yahoogroups.com, "Nagasamudram, Prasanna Kumar"
<prasanna.nagasamudram@...> wrote:
>
> Hi Caridy
>
>
>
> Thanks that worked.
>
>
>
> My next question would be instead of alert("Already exists"), can I
make that tab as the active tab ?
>
>
>
> For example instead of saying tab1 already exists, the control
should just go to the tab1(I mean tab1 should be on the top now).
>
>
>
> How do I get the pointer to the tab with id guid ?
>
>
>
>
>
>
>
> Thanks
>
> Prasanna
>
>
>
>
>
> ________________________________
>
> From: ydn-javascript@yahoogroups.com
[mailto:ydn-javascript@yahoogroups.com] On Behalf Of Caridy Patiño Mayea
> Sent: Thursday, August 30, 2007 10:39 PM
> To: ydn-javascript@yahoogroups.com
> Subject: [ydn-javascript] Re: Tab already exists ... (global unique
ID for each tab)
>
>
>
> Hi Prasanna,
>
> Use a global unique ID for each tab:
>
> function addTab(title, text, guid) {
> if (!YAHOO.util.Dom.inDocument(guid)) {
> // do your stuff here...
> .....
> // add the guid to the tab
> tab.labelEl.id = guid;
> return tab;
> }
> return null;
> }
>
> Link1.onclick {
> if (!addTab("new tab title", "new tab text", "mytab1guid")) {
> alert("Already exists");
> }
> }
>
> PD: I never tested it, but should work...
>
> Best Regards,
> Caridy (caridy at gmail.com)
> http://www.bubbling-library.com/ <http://www.bubbling-library.com/>
>
> --- In ydn-javascript@yahoogroups.com
<mailto:ydn-javascript%40yahoogroups.com> , "Nagasamudram, Prasanna Kumar"
> <prasanna.nagasamudram@> wrote:
> >
> > Hi All
> >
> >
> >
> > How does one know that the tab already exists ?
> >
> >
> >
> > For Eg :
> >
> >
> >
> > I have three links
> >
> >
> >
> > Link1 , Link2 and Link3
> >
> >
> >
> > Clicking on which a new tab opens.
> >
> >
> >
> > But when I click on Link1 for the second, I should get an alert saying
> > that the tab already exists..
> >
> >
> >
> > I have the following logic...
> >
> >
> >
> > function addTab(title, text)
> >
> > {
> >
> > if(!window.tabView)
> >
> > {
> >
> > tabView = new YAHOO.widget.TabView( { id: 'demo' } );
> >
> > tabView.appendTo('tabContainer');
> >
> > }
> >
> > tab = new YAHOO.widget.Tab({
> >
> > label: title,
> >
> > content: '',
> >
> > active: true
> >
> > });
> >
> > tabView.addTab( tab );
> >
> >
> >
> > YAHOO.util.Dispatcher.process( tab, text, {action: 'tabview'} );
> >
> >
> >
> > return tab;
> >
> >
> >
> >
> >
> > }
> >
> >
> >
> >
> >
> >
> >
> > Link1.onclick
> >
> > {
> >
> > If window.T1
> >
> > Alert(Already exists);
> >
> > else
> >
> > T1 = addTab("T1", "Hello T1");
> >
> > }
> >
> >
> >
> > But suppose tab T1 is closed and then the Link1 is clicked then
still i
> > will get the, "already exists message.
> >
> >
> >
> > How do I remove the T1 variable when I close the tab ?
> >
> >
> >
> > Thanks
> >
> > Prasanna
> >
>

#17576 From: "dave2002002" <dave2002002@...>
Date: Sat Sep 1, 2007 10:58 pm
Subject: Re: Error in IE using TabView
dave2002002
Send Email Send Email
 
same problem if i remove the form tags.... www.amateurartauction.co.uk


--- In ydn-javascript@yahoogroups.com, Gopal Venkatesan <gopal@...> wrote:
>
> On Fri, Aug 31, 2007 at 02:44:06PM -0000, dave2002002 wrote:
> > *bump*
> >
> > --- In ydn-javascript@yahoogroups.com, "dave2002002"
> > <dave2002002@> wrote:
> > >
> > > No-one have any ideas? its rather frustrating as if its not
> > possible
> > > ill have 2 re-think how i display things...
> > >
> > > --- In ydn-javascript@yahoogroups.com, "dave2002002" <dave2002002@>
> > > wrote:
> > > >
> > > > I've sorted the server error, that was my bad, the code was
> > copied and
> > > > pasted from the members area... but the initial problem still
> > remains.
> > > >
>
> The problem in your script that you're inserting a "form" tag within
> another "form" tag.  IE has been a known culprit in this regard simply
> throwing an "Unknown runtime error".
>
> You can try the simple example below on Firefox and IE:
>
>   http://gopalarathnam.com/examples/javascript/iemadness.html
>
> The above example works fine in Firefox, whereas throws an "Unknown
> runtime error" in IE 6 and 7, yes it is not yet regressed ;)
>
> HTH.
>
> --
> Gopal Venkatesan
>
> http://gopalarathnam.com/weblog/
>

#17577 From: "sagar_balla" <sagar.balla@...>
Date: Sun Sep 2, 2007 12:13 am
Subject: Panel with Minimize Button
sagar_balla
Send Email Send Email
 
I want to create panels with Minimize button. If any one tried this
option previously then please let me know

Thanks,
Sagar

#17578 From: "sudermatt" <sudermatt@...>
Date: Sun Sep 2, 2007 2:35 am
Subject: Datatable Problem : datasource has no properties
sudermatt
Send Email Send Email
 
I tried to keep it really simple for a scrollable datatable.

I'm getting a "datasource has no properties" error on the line
this.myDataSource.responseType.... line

Here is the complete page code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
     <title>Untitled Page</title>

<!--CSS file (default YUI Sam Skin) -->
<link type="text/css" rel="stylesheet"
href="http://yui.yahooapis.com/2.3.0/build/datatable/assets/skins/sam/datatable.\
css">

<!-- Dependencies -->
<script type="text/javascript"
src="http://yui.yahooapis.com/2.3.0/build/yahoo-dom-event/yahoo-dom-event.js"></\
script>
<script type="text/javascript"
src="http://yui.yahooapis.com/2.3.0/build/element/element-beta-min.js"></script>
<script type="text/javascript"
src="http://yui.yahooapis.com/2.3.0/build/datasource/datasource-beta-min.js"></s\
cript>

<!-- OPTIONAL: External JSON parser from http://www.json.org/ (enables
JSON validation) -->
<script type="text/javascript" src="http://www.json.org/json.js"></script>

<!-- OPTIONAL: Connection (enables XHR) -->
<script type="text/javascript"
src="http://yui.yahooapis.com/2.3.0/build/connection/connection-min.js"></script\
>

<!-- OPTIONAL: Drag Drop (enables resizeable columns) -->
<script type="text/javascript"
src="http://yui.yahooapis.com/2.3.0/build/dragdrop/dragdrop-min.js"></script>

<!-- OPTIONAL: Calendar (enables calendar editors) -->
<script type="text/javascript"
src="http://yui.yahooapis.com/2.3.0/build/calendar/calendar-min.js"></script>

<!-- Source files -->
<script type="text/javascript"
src="http://yui.yahooapis.com/2.3.0/build/datatable/datatable-beta-min.js"></scr\
ipt>

<style type="text/css">
#myContainer{
     height:20em;
     }
/* customized css for scrolling */
.yui-dt-scrollable  {
     width:30em; /* SET OVERALL WIDTH HERE for ie (make sure columns
add up to this total) */
     height:30em; /* SET HEIGHT HERE for ie */
}
.yui-dt-scrollbody {
     height:30em; /* SET HEIGHT HERE for non-ie */
     *height:auto; /* for ie */
}
.yui-dt-scrollable  thead {
     background:#696969; /*dark gray*/ /* ie needs a background color */
     color:#fff;
}

/* SET WIDTHS FOR EACH TH TO HELP ALIGN COLUMNS */
/* IF ALL COLS CAN BE SAME WIDTH USE THIS:
.yui-dt-scrollable th, .yui-dt-scrollbody td {
     width:20em;
}*/
/* OTHERWISE SET EACH COL WIDTH EXPLICITLY:*/
.yui-dt-col-one {
     width:10em;
}
.yui-dt-col-two {
     width:20em;
}
</style>

<script language=javascript>
YAHOO.example.UserPoints = [
{UserID:218,UserName:"KellyG",AvgPoints:0.29475,NumPred:4},
{UserID:221,UserName:"laughlind55",AvgPoints:0.363375,NumPred:4},
{UserID:211,UserName:"Bronco85",AvgPoints:0.43125,NumPred:6},
{UserID:224,UserName:"macnut",AvgPoints:0.4329,NumPred:5},
{UserID:49,UserName:"BroncoBailey",AvgPoints:0.4365,NumPred:4},
{UserID:54,UserName:"NEZ4EVER",AvgPoints:0.4955,NumPred:5},
{UserID:235,UserName:"admiral",AvgPoints:0.548833,NumPred:3},
{UserID:29,UserName:"boiseSt8Rules",AvgPoints:0.560389,NumPred:18},
{UserID:231,UserName:"bsuwillwin",AvgPoints:0.675367,NumPred:15},
{UserID:219,UserName:"hkhaole",AvgPoints:0.800106,NumPred:33},
{UserID:33,UserName:"BroncoJunky",AvgPoints:0.810792,NumPred:12},
{UserID:201,UserName:"DAcruSHA",AvgPoints:0.828389,NumPred:9},
{UserID:229,UserName:"BroncNuts",AvgPoints:0.886561,NumPred:33},
{UserID:213,UserName:"Bulldogmike",AvgPoints:0.887912,NumPred:34},
{UserID:236,UserName:"terrapin999",AvgPoints:1.03925,NumPred:4},
{UserID:228,UserName:"BroncoBob",AvgPoints:1.072556,NumPred:9},
{UserID:226,UserName:"surus",AvgPoints:1.082333,NumPred:3},
{UserID:0,UserName:"",AvgPoints:0,NumPred:0}
];


</script>

</head>
<body class=" yui-skin-sam">
<div id="myContainer">
</div>
huh

<script  type="text/javascript">


YAHOO.util.Event.addListener(window, "load", function() {
     YAHOO.example.Scrolling = new function() {
         var myColumnDefs = [
             {key:"UserID", label:"User ID"},
             {key:"UserName", label:"User Name"},
             {key:"AvgPoints", label:"Avg. Points"},
             {key:"NumPred", label:"Num. Pred."}
         ];

         var myDataSource = new
YAHOO.util.DataSource(YAHOO.example.UserPoints);
         this.myDataSource.responseType =
YAHOO.util.DataSource.TYPE_JSARRAY;
         myDataSource.responseSchema = {
             fields: ["UserID","UserName","AvgPoints","NumPred"]
         };

         this.myDataTable = new YAHOO.widget.DataTable("myContainer",
myColumnDefs,
                 this.myDataSource, {scrollable:true});
     };
});
</script>

</body>
</html>

#17579 From: "someguynameddylan" <DylanTheDeveloper@...>
Date: Sun Sep 2, 2007 2:58 am
Subject: Re: Internet Explorer loads a single image X times
someguynamed...
Send Email Send Email
 
Create an image object and set the source to the url of the image.

i.e:
var imgObj = new Image();
imgObj.src = "http://not.a.url/img.gif";

that will at least cache it in the browser and minimize those i.e
requests.

--- In ydn-javascript@yahoogroups.com, "keos_keos" <keos_keos@...>
wrote:
>
> I'm building a Tree Widget with the YUI library.
> I'm using a few functions to simplify the coding, and it works out
> great. The Javascript code is shown on the screen.
>
> The problem is, that IE6 loads the same image every time it creates
a
> link. That's a HUGE overhead. IE7 is slow on this, but still manages
> to do the task. I don't know how many times it loads the image.
>
> Any ideas how I can fix this, to make the code load fast?
>
>
> var tmpNode = buildTreeTrunk(buildRow("Test", 270), root);
> var tmpNode = buildTreeTrunk(buildRow("Test", 271), root);
>
> function buildTreeTrunk(html, node) {
>  var newnode = new YAHOO.widget.HTMLNode(html, node, false,
true);
>  return newnode;
> }
>
> function buildRow(label, number) {
>  var row = "";
>  row = buildLink('admin/sections/view/' + number, label,
false);
>  row += buildLink('admin/sections/edit/' + number + '/',
$ImgDir +
> "edit.gif", true);
>  row += buildLink('admin/sections/delete/' + number + '/',
$ImgDir +
> "delete.gif", true);
>
>  return row;
> }
> function buildLink(href, label, imageonly) {
>  var code = "";
>
>  if(imageonly==false)
> 	 code = '<div class="treelink"><a href="' + $BaseURL +
href + '">' +
> label  + '</a></div>';
>  else
> 	 code = '<a href="' + $BaseThemeURL + href + '"><img
src="' + label
> + '" /></a>';
>  return code;
> }
>

#17580 From: Gopal Venkatesan <gopal@...>
Date: Sun Sep 2, 2007 4:17 am
Subject: Re: Re: Error in IE using TabView
gopalarathnam_v
Send Email Send Email
 
On Sat, Sep 01, 2007 at 10:58:35PM -0000, dave2002002 wrote:
> same problem if i remove the form tags.... www.amateurartauction.co.uk
>
>

Looking at:

   http://www.amateurartauction.co.uk/Gallery.aspx

I can see:

   <form name="aspnetForm" method="post" action="Gallery.aspx" id="aspnetForm">

immediately after the "body" element.

And the URL for the tabs:

   http://www.amateurartauction.co.uk/profileframe.aspx?view=Sold

returning me something like:

   <form name="ctl00" method="post" action="profileframe.aspx?view=Sold"
id="ctl00">
   <!-- ... -->
   </div></form>

When the tab content gets inserted you get a "form" element within
another "form" element.  This is not allowed as per W3C HTML
specification, which generates the "Unknown runtime error" in Internet
Explorer.

You need to remove one of these "form" elements so that you don't get a
"form" within another.

HTH.

PS. am I looking at the correct URL?

--
Gopal Venkatesan

http://gopalarathnam.com/weblog/

#17581 From: Gopal Venkatesan <gopal@...>
Date: Sun Sep 2, 2007 4:36 am
Subject: Re: Datatable Problem : datasource has no properties
gopalarathnam_v
Send Email Send Email
 
On Sun, Sep 02, 2007 at 02:35:09AM -0000, sudermatt wrote:
> I tried to keep it really simple for a scrollable datatable.
>
> I'm getting a "datasource has no properties" error on the line
> this.myDataSource.responseType.... line
>
> Here is the complete page code:
>
>         var myDataSource = new

           ^^^^

That should have been "this.myDataSource".

Eric Miraglia has written an excellent article explaining the
module pattern[1] on YUIBlog[2].

[1] http://yuiblog.com/blog/2007/06/12/module-pattern/
[2] http://yuiblog.com/blog/

--
Gopal Venkatesan

http://gopalarathnam.com/weblog/

#17582 From: "chonlia" <juanluis.suarez@...>
Date: Sun Sep 2, 2007 8:00 am
Subject: Calendar - Preventing click before double-click
chonlia
Send Email Send Email
 
I find a function to prevent click before double-click using
window.setTimeout.

The problem is i don't know how pass parameters.

At calendar.js, doSelectCell:

click_timer = window.setTimeout
(YAHOO.widget.Calendar.prototype.doSelectCell(e, cal), 300);

And at my custom doDblSelectCell:

window.clearTimeout(click_timer);


Don't works, because setTimeout crash.

:-(

#17583 From: "kaffeeringe" <steffen.voss@...>
Date: Sun Sep 2, 2007 9:40 am
Subject: Grids: 4 uneven Columns
kaffeeringe
Send Email Send Email
 
Hi all!

This is my first question here, so please don't smack me, if I do
something wrong ;-)

I am trying to implement a 4 column layout:
narrow, wide, narrow, narrow

I tried this

<div class="yui-gc">
     <div class="yui-gf first">
         <div class="yui-u first">
	 Block 1
	         </div>
         <div class="yui-u">
	 Block 2
	         </div>
     </div>
     <div class="yui-g">
         <div class="yui-u first">
	 Block 3
	         </div>
         <div class="yui-u">
	 Block 4
	         </div>
     </div>
</div>

But the layout breaks in both IE7 and FF2. Can anybody help me out?

#17584 From: "dave2002002" <dave2002002@...>
Date: Sun Sep 2, 2007 9:50 am
Subject: Re: Error in IE using TabView
dave2002002
Send Email Send Email
 
Hi, thanks for having a look, that is the right URL, but the form tags
seem to be auto-generated... so im not sure how 2 solve that?


--- In ydn-javascript@yahoogroups.com, Gopal Venkatesan <gopal@...> wrote:
>
> On Sat, Sep 01, 2007 at 10:58:35PM -0000, dave2002002 wrote:
> > same problem if i remove the form tags.... www.amateurartauction.co.uk
> >
> >
>
> Looking at:
>
>   http://www.amateurartauction.co.uk/Gallery.aspx
>
> I can see:
>
>   <form name="aspnetForm" method="post" action="Gallery.aspx"
id="aspnetForm">
>
> immediately after the "body" element.
>
> And the URL for the tabs:
>
>   http://www.amateurartauction.co.uk/profileframe.aspx?view=Sold
>
> returning me something like:
>
>   <form name="ctl00" method="post"
action="profileframe.aspx?view=Sold" id="ctl00">
>   <!-- ... -->
>   </div></form>
>
> When the tab content gets inserted you get a "form" element within
> another "form" element.  This is not allowed as per W3C HTML
> specification, which generates the "Unknown runtime error" in Internet
> Explorer.
>
> You need to remove one of these "form" elements so that you don't get a
> "form" within another.
>
> HTH.
>
> PS. am I looking at the correct URL?
>
> --
> Gopal Venkatesan
>
> http://gopalarathnam.com/weblog/
>

#17585 From: "fhs.ecommerce" <fhs.ecommerce@...>
Date: Sun Sep 2, 2007 10:25 am
Subject: Re: Delay mouseover in tabview
fhs.ecommerce
Send Email Send Email
 
Nobody an idea or suggestion?

#17587 From: "dave2002002" <dave2002002@...>
Date: Sun Sep 2, 2007 11:56 am
Subject: Re: Error in IE using TabView
dave2002002
Send Email Send Email
 
updated URL - http://www.amateurartauction.co.uk/yuitest.aspx

--- In ydn-javascript@yahoogroups.com, "dave2002002" <dave2002002@...>
wrote:
>
> Hi, thanks for having a look, that is the right URL, but the form tags
> seem to be auto-generated... so im not sure how 2 solve that?
>
>
> --- In ydn-javascript@yahoogroups.com, Gopal Venkatesan <gopal@> wrote:
> >
> > On Sat, Sep 01, 2007 at 10:58:35PM -0000, dave2002002 wrote:
> > > same problem if i remove the form tags....
www.amateurartauction.co.uk
> > >
> > >
> >
> > Looking at:
> >
> >   http://www.amateurartauction.co.uk/Gallery.aspx
> >
> > I can see:
> >
> >   <form name="aspnetForm" method="post" action="Gallery.aspx"
> id="aspnetForm">
> >
> > immediately after the "body" element.
> >
> > And the URL for the tabs:
> >
> >   http://www.amateurartauction.co.uk/profileframe.aspx?view=Sold
> >
> > returning me something like:
> >
> >   <form name="ctl00" method="post"
> action="profileframe.aspx?view=Sold" id="ctl00">
> >   <!-- ... -->
> >   </div></form>
> >
> > When the tab content gets inserted you get a "form" element within
> > another "form" element.  This is not allowed as per W3C HTML
> > specification, which generates the "Unknown runtime error" in
Internet
> > Explorer.
> >
> > You need to remove one of these "form" elements so that you don't
get a
> > "form" within another.
> >
> > HTH.
> >
> > PS. am I looking at the correct URL?
> >
> > --
> > Gopal Venkatesan
> >
> > http://gopalarathnam.com/weblog/
> >
>

#17588 From: Rodrigo Haas <rodrigohaasbrasil@...>
Date: Sun Sep 2, 2007 8:31 pm
Subject: Re: data table formatLink problem
rodrigohaasb...
Send Email Send Email
 
Satyam,

Thanks for response!

I am using YUI 2.3.0.

Look my code:

<code>

this.myDataSource = new YAHOO.util.DataSource(uri);
   
 
    this.myDataSource.responseType = YAHOO.util.DataSource.TYPE_TEXT;
   
    this.myDataSource.responseSchema = {
        recordDelim: "|", // Record delimiter
        fieldDelim: ",", // Field delimiter
        fields: ["VIA_TIPO","VIA_TITULO","NOMEVIA","SUBLOTE","NUMERO","BAIRRO","NUM_CEP","DESCRICAO","SITE"]  

    }
   
    var myConfigs = {
                paginated:true,
                paginator: {
                    rowsPerPage: 10,
                    dropdownOptions: [10,20,30,50,100]
                },
                pageLinks: 3
        }
 
    this.myDataTable = new YAHOO.widget.DataTable("basic", myColumnDefs,     this.myDataSource, myConfigs,{caption:"DataTable Consulta",           selectionMode:"single"} );
   
    // Subscribe to events for row selection
        this.myDataTable.subscribe("rowMouseoverEvent", this.myDataTable.onEventHighlightRow);
        this.myDataTable.subscribe("rowMouseoutEvent", this.myDataTable.onEventUnhighlightRow);
        this.myDataTable.subscribe("rowClickEvent", this.myDataTable.onEventSelectRow);


    }

</code>

when not using "row selection" the link in DataTable query result works fine...

I believe to be a bug in Yui DataTable!


Thanks again,


Rodrigo Haas



Satyam <satyam@...> escreveu:
I remember that links didn't work in some old version of YUI, 2.1 or before.  They were fixed, or so I recall, I didn't test them myself, in 2.2 or thereabouts.
 
Satyam
_._,___

Flickr agora em português. Você clica, todo mundo vê. Saiba mais.


#17589 From: "Satyam" <satyam@...>
Date: Sun Sep 2, 2007 9:11 pm
Subject: Re: data table formatLink problem
satyamutsa
Send Email Send Email
 
I just checked the source and this has changed from 2.2.2 to 2.3.0 so whatever I recalled from previous versions does not matter.
 
You would have to listen to linkClickEvent, which will fire before rowClickEvent. 
 
 
 
You can see it in datatable-beta.js, search for the method:
 
YAHOO.widget.DataTable.prototype._onTbodyClick
 
and you will see that it loops through all the elements from the one clicked outwards, like bubbling,until ir reaches the <table> element itself. 
 
What I don't know is how to stop it from bubbling all the way up.  If you find out, let us know.
 
Satyam
 
 
 
 
 
 
----- Original Message -----
Sent: Sunday, September 02, 2007 10:31 PM
Subject: Re: [ydn-javascript] data table formatLink problem

Satyam,

Thanks for response!

I am using YUI 2.3.0.

Look my code:

<code>

this.myDataSource = new YAHOO.util.DataSource(uri);
   
 
    this.myDataSource.responseType = YAHOO.util.DataSource.TYPE_TEXT;
   
    this.myDataSource.responseSchema = {
        recordDelim: "|", // Record delimiter
        fieldDelim: ",", // Field delimiter
        fields: ["VIA_TIPO","VIA_TITULO","NOMEVIA","SUBLOTE","NUMERO","BAIRRO","NUM_CEP","DESCRICAO","SITE"]  

    }
   
    var myConfigs = {
                paginated:true,
                paginator: {
                    rowsPerPage: 10,
                    dropdownOptions: [10,20,30,50,100]
                },
                pageLinks: 3
        }
 
    this.myDataTable = new YAHOO.widget.DataTable("basic", myColumnDefs,     this.myDataSource, myConfigs,{caption:"DataTable Consulta",           selectionMode:"single"} );
   
    // Subscribe to events for row selection
        this.myDataTable.subscribe("rowMouseoverEvent", this.myDataTable.onEventHighlightRow);
        this.myDataTable.subscribe("rowMouseoutEvent", this.myDataTable.onEventUnhighlightRow);
        this.myDataTable.subscribe("rowClickEvent", this.myDataTable.onEventSelectRow);


    }

</code>

when not using "row selection" the link in DataTable query result works fine...

I believe to be a bug in Yui DataTable!


Thanks again,


Rodrigo Haas



Satyam <satyam@...> escreveu:
I remember that links didn't work in some old version of YUI, 2.1 or before.  They were fixed, or so I recall, I didn't test them myself, in 2.2 or thereabouts.
 
Satyam
_._,___

Flickr agora em português. Você clica, todo mundo vê. Saiba mais.


No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.484 / Virus Database: 269.13.2/983 - Release Date: 01/09/2007 16:20

#17590 From: "Satyam" <satyam@...>
Date: Sun Sep 2, 2007 11:06 pm
Subject: Re: data table formatLink problem
satyamutsa
Send Email Send Email
 
I think I have a better one.  Change this line:
 
     this.myDataTable.subscribe("rowClickEvent", this.myDataTable.onEventSelectRow);
 
to this:
 
     this.myDataTable.subscribe("rowClickEvent", function (o) {
        if (o.target.tagName.toLowerCase() != 'a') {
            this.myDataTable.onEventSelectRow);
        }
    });
 
That means, if the target of the event is  not a link, go on an select the row, if it is, do nothing.  The event will eventually bubble out and with nothing to stop it, the link will be followed through.  The problem, I think, is that the onEventSelectRow does a   YAHOO.util.Event.stopEvent(evt); (actually in line 6257) which prevents the event to follow in its tracks.  
 
So, if you actually want the link to be followed, the above solution might be easier.  If you want to do something else with the link, you can listen to linkClickEvent and stop the event propation there.  Nevertheless, stopping the natural propagation of the event would not prevent the loop at _onTbodyClick from carrying on so the rowClickEvent would be triggered as well as all the rest.
 
Give it a try and let us know.  Obrigado
 
Satyam
 
 
 
----- Original Message -----
From: Satyam
Sent: Sunday, September 02, 2007 11:11 PM
Subject: Re: [ydn-javascript] data table formatLink problem

I just checked the source and this has changed from 2.2.2 to 2.3.0 so whatever I recalled from previous versions does not matter.
 
You would have to listen to linkClickEvent, which will fire before rowClickEvent. 
 
 
 
You can see it in datatable-beta.js, search for the method:
 
YAHOO.widget.DataTable.prototype._onTbodyClick
 
and you will see that it loops through all the elements from the one clicked outwards, like bubbling,until ir reaches the <table> element itself. 
 
What I don't know is how to stop it from bubbling all the way up.  If you find out, let us know.
 
Satyam
 
 
 
 
 
 
----- Original Message -----
Sent: Sunday, September 02, 2007 10:31 PM
Subject: Re: [ydn-javascript] data table formatLink problem

Satyam,

Thanks for response!

I am using YUI 2.3.0.

Look my code:

<code>

this.myDataSource = new YAHOO.util.DataSource(uri);
   
 
    this.myDataSource.responseType = YAHOO.util.DataSource.TYPE_TEXT;
   
    this.myDataSource.responseSchema = {
        recordDelim: "|", // Record delimiter
        fieldDelim: ",", // Field delimiter
        fields: ["VIA_TIPO","VIA_TITULO","NOMEVIA","SUBLOTE","NUMERO","BAIRRO","NUM_CEP","DESCRICAO","SITE"]  

    }
   
    var myConfigs = {
                paginated:true,
                paginator: {
                    rowsPerPage: 10,
                    dropdownOptions: [10,20,30,50,100]
                },
                pageLinks: 3
        }
 
    this.myDataTable = new YAHOO.widget.DataTable("basic", myColumnDefs,     this.myDataSource, myConfigs,{caption:"DataTable Consulta",           selectionMode:"single"} );
   
    // Subscribe to events for row selection
        this.myDataTable.subscribe("rowMouseoverEvent", this.myDataTable.onEventHighlightRow);
        this.myDataTable.subscribe("rowMouseoutEvent", this.myDataTable.onEventUnhighlightRow);
        this.myDataTable.subscribe("rowClickEvent", this.myDataTable.onEventSelectRow);


    }

</code>

when not using "row selection" the link in DataTable query result works fine...

I believe to be a bug in Yui DataTable!


Thanks again,


Rodrigo Haas



Satyam <satyam@...> escreveu:
I remember that links didn't work in some old version of YUI, 2.1 or before.  They were fixed, or so I recall, I didn't test them myself, in 2.2 or thereabouts.
 
Satyam
_._,___

Flickr agora em português. Você clica, todo mundo vê. Saiba mais.


No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.484 / Virus Database: 269.13.2/983 - Release Date: 01/09/2007 16:20


No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.484 / Virus Database: 269.13.2/983 - Release Date: 01/09/2007 16:20

#17591 From: David Seruyange <idmkid@...>
Date: Mon Sep 3, 2007 1:54 am
Subject: YUI book
idmkid
Send Email Send Email
 
Is anyone at work on a YUI book?  I've seen a few javascript or "web 2.0" books with YUI mentioned, but I'm wondering if anyone's thought of making a reference. I like YUI but the equivalent of David Flangan's "Rhino Book" for YUI would make it a javascript library kingpin.

David


Take the Internet to Go: Yahoo!Go puts the Internet in your pocket: mail, news, photos more.

#17592 From: Eric Miraglia <miraglia@...>
Date: Mon Sep 3, 2007 4:45 am
Subject: Re: YUI book
ericmiraglia
Send Email Send Email
 
David,

I believe that there are some books in the works, based on what I've heard from publishers.  I'm not sure that anything has been announced as yet, but I'd be surprised if we didn't see some titles come out next year.

Regards,
Eric


______________________________________________
Eric Miraglia
Yahoo! User Interface Library


On Sep 2, 2007, at 6:54 PM, David Seruyange wrote:


Is anyone at work on a YUI book?  I've seen a few javascript or "web 2.0" books with YUI mentioned, but I'm wondering if anyone's thought of making a reference. I like YUI but the equivalent of David Flangan's "Rhino Book" for YUI would make it a javascript library kingpin.

David


Take the Internet to Go: Yahoo!Go puts the Internet in your pocket: mail, news, photos more.



#17593 From: stefan@...
Date: Mon Sep 3, 2007 6:57 am
Subject: Re: Re: Problem with Dialog
urkmansturm
Send Email Send Email
 
Hello,

thanks for your answer. But my problem is, that my page allready contails a form. So I have something like this:

<form action="page.php">
    <div style="font-size: 12px; font-weight: normal; text-transform: none; color: #FFFFFF;">
        <div id="myDialog">
            <form method="post" action="page.php">
            <div class="hd" style="font-size: 14px; font-weight: bold; color: #000000;">Suchen</div>
            <div class="bd" style="color: #000000; text-align: left;">
                <p>Geben sie bitte einen Suchbegriff ein:</p>
                <label for="SearchString">Suchen:</label><input type="text" id="searchString" name="searchString" />
            </div>
            </form>
        </div>
    </div>
</form>

Now my "inner form" has an sction, but with the "outer" form it is still the same. The rendered HTML Code looks like this ( shortened ) :
<div style="visibility: inherit; width: 400px;" class="yui-module yui-overlay yui-panel" id="myDialog">
<div id="myDialog_h" class="hd" style="font-size: 14px; font-weight: bold; color: rgb(0, 0, 0); cursor: move;">
Suchen
</div>
<div class="bd" style="color: rgb(0, 0, 0); text-align: left;">
<p>
Geben sie bitte einen Suchbegriff ein:
</p>
<label for="SearchString">
Suchen:
</label>
  <input id="searchString" name="searchString" type="text">
<form name="frm_myDialog">
</form>
</div>
I hope, it is not a problem to have a form, that spanning the whole page..

Thanks for you help,
Stefan Sturm


 

Hello,
I see your code and find that the form tag lost the prototype of "action", so occur error because uri is empty(null) when the XMLHTTPRequest post the data.
You can add the "action" prototype with your form to avoid the error.
 
Follow is my code.
 
/****************************************************/

<html>
<head>
<title>test</title>
<link rel="stylesheet" type="text/css" href="../../build/fonts/fonts-min.css" />
<link rel="stylesheet" type="text/css" href="../../build/button/assets/skins/sam/button.css" />
<link rel="stylesheet" type="text/css" href="../../build/container/assets/skins/sam/container.css" />
<script type="text/javascript" src="../../build/utilities/utilities.js"></script>
<script type="text/javascript" src="../../build/button/button-beta.js"></script>
<script type="text/javascript" src="../../build/container/container.js"></script>
</head>
<body class=" yui-skin-sam" id="yahoo-com">
    <script>
        YAHOO.namespace("CoRAN.container");
       
        function init() {

            var handleSubmit = function() {
                alert( 'handleSubmit' )
                var searchString = this.getData().searchString;
                alert( searchString );
                this.submit();
            }

            var handleSuccess = function(o) {
                alert( "handleSuccess" );
            };

            var handleFailure = function(o) {
                alert("Submission failed: " + o.status);
            };

            YAHOO.CoRAN.container.myDialog = new YAHOO.widget.Dialog("myDialog",
                {
                    postmethod: "async",
                    width: "400px",
                    modal: true,
                    visible : false,
                    x: 200,
                    y: 200,
                    constraintoviewport : true,
                    buttons :
                    [
                        { text:"Suchen", handler:handleSubmit, isDefault:true }
                    ]
                }
            );

            // Wire up the success and failure handlers
            YAHOO.CoRAN.container.myDialog.callback =
            {
                success: handleSuccess,
                failure: handleFailure
            };

            YAHOO.CoRAN.container.myDialog.render();
 
            YAHOO.util.Event.addListener("btnClick", "click", YAHOO.CoRAN.container.myDialog.show, YAHOO.CoRAN.container.myDialog, true);
        }

        YAHOO.util.Event.onDOMReady(init);
    </script>
    <a href="#" id="btnClick">Click</a>
   
    <div style="font-size: 12px; font-weight: normal; text-transform: none; color: #FFFFFF;">
        <div id="myDialog">
            <form method="post" action="test.jsp">  <!-- not lost the "action" prototype!!! //-->
            <div class="hd" style="font-size: 14px; font-weight: bold; color: #000000;">Suchen</div>
            <div class="bd" style="color: #000000; text-align: left;">
                <p>Geben sie bitte einen Suchbegriff ein:</p>
                <label for="SearchString">Suchen:</label><input type="text" id="searchString" name="searchString" />
            </div>
            </form>
        </div>
    </div>
    </body>
</html>

/***********************************************************************/


#17594 From: "Satyam" <satyam@...>
Date: Mon Sep 3, 2007 7:13 am
Subject: Re: Re: Problem with Dialog
satyamutsa
Send Email Send Email
 

Two forms, actually.
 
----- Original Message -----
From: stefan@...
Sent: Monday, September 03, 2007 8:57 AM
Subject: Re: [ydn-javascript] Re: Problem with Dialog

Hello,

thanks for your answer. But my problem is, that my page allready contails a form. So I have something like this:

<form action="page.php">
    <div style="font-size: 12px; font-weight: normal; text-transform: none; color: #FFFFFF;">
        <div id="myDialog">
            <form method="post" action="page.php">
            <div class="hd" style="font-size: 14px; font-weight: bold; color: #000000;">Suchen</div>
            <div class="bd" style="color: #000000; text-align: left;">
                <p>Geben sie bitte einen Suchbegriff ein:</p>
                <label for="SearchString">Suchen:</label><input type="text" id="searchString" name="searchString" />
            </div>
            </form>
        </div>
    </div>
</form>

Now my "inner form" has an sction, but with the "outer" form it is still the same. The rendered HTML Code looks like this ( shortened ) :
<div style="visibility: inherit; width: 400px;" class="yui-module yui-overlay yui-panel" id="myDialog">
<div id="myDialog_h" class="hd" style="font-size: 14px; font-weight: bold; color: rgb(0, 0, 0); cursor: move;">
Suchen
</div>
<div class="bd" style="color: rgb(0, 0, 0); text-align: left;">
<p>
Geben sie bitte einen Suchbegriff ein:
</p>
<label for="SearchString">
Suchen:
</label>
  <i nput id="searchString" name="searchString" type="text">
<form name="frm_myDialog">
</form>
</div>
I hope, it is not a problem to have a form, that spanning the whole page..

Thanks for you help,
Stefan Sturm


 

Hello,
I see your code and find that the form tag lost the prototype of "action", so occur error because uri is empty(null) when the XMLHTTPRequest post the data.
You can add the "action" prototype with your form to avoid the error.
 
Follow is my code.
 
/****************************************************/

<html>
<head>
<title>test</title>
<link rel="stylesheet" type="text/css" href="../../build/fonts/fonts-min.css" />
<link rel="stylesheet" type="text/css" href="../../build/button/assets/skins/sam/button.css" />
<link rel="stylesheet" type="text/css" href="../../build/container/assets/skins/sam/container.css" />
<script type="text/javascript" src="../../build/utilities/utilities.js"></script>
<script type="text/javascript" src="../../build/button/button-beta.js"></script>
<script type="text/javascript" src="../../build/container/container.js"></script>
</head>
<body class=" yui-skin-sam" id="yahoo-com">
    <script>
        YAHOO.namespace("CoRAN.container");
       
        function init() {

            var handleSubmit = function() {
                alert( 'handleSubmit' )
                var searchString = this.getData().searchString;
                alert( searchString );
                this.submit();
            }

            var handleSuccess = function(o) {
                alert( "handleSuccess" );
            };

            var handleFailure = function(o) {
                alert("Submission failed: " + o.status);
            };

            YAHOO.CoRAN.container.myDialog = new YAHOO.widget.Dialog("myDialog",
                {
                    postmethod: "async",
                    width: "400px",
                    modal: true,
                    visible : false,
                    x: 200,
                    y: 200,
                    constraintoviewport : true,
                    buttons :
                    [
                        { text:"Suchen", handler:handleSubmit, isDefault:true }
                    ]
                }
            );

            // Wire up the success and failure handlers
            YAHOO.CoRAN.container.myDialog.callback =
            {
                success: handleSuccess,
                failure: handleFailure
            };

            YAHOO.CoRAN.container.myDialog.render();
 
            YAHOO.util.Event.addListener("btnClick", "click", YAHOO.CoRAN.container.myDialog.show, YAHOO.CoRAN.container.myDialog, true);
        }

        YAHOO.util.Event.onDOMReady(init);
    </script>
    <a href="#" id="btnClick">Click</a>
   
    <div style="font-size: 12px; font-weight: normal; text-transform: none; color: #FFFFFF;">
        <div id="myDialog">
            <form method="post" action="test.jsp">  <!-- not lost the "action" prototype!!! //-->
            <div class="hd" style="font-size: 14px; font-weight: bold; color: #000000;">Suchen</div>
            <div class="bd" style="color: #000000; text-align: left;">
                <p>Geben sie bitte einen Suchbegriff ein:</p>
                <label for="SearchString">Suchen:</label><input type="text" id="searchString" name="searchString" />
            </div>
            </form>
        </div>
    </div>
    </body>
</html>

/***********************************************************************/


No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.484 / Virus Database: 269.13.2/985 - Release Date: 02/09/2007 16:32

#17595 From: "Satyam" <satyam@...>
Date: Mon Sep 3, 2007 7:14 am
Subject: Re: data table formatLink problem
satyamutsa
Send Email Send Email
 
There is a typo in the code below, the line within the conditional should be:
 
            this.myDataTable.onEventSelectRow(o);
 
----- Original Message -----
From: Satyam
Sent: Monday, September 03, 2007 1:06 AM
Subject: Re: [ydn-javascript] data table formatLink problem

I think I have a better one.  Change this line:
 
     this.myDataTable.subscribe("rowClickEvent", this.myDataTable.onEventSelectRow);
 
to this:
 
     this.myDataTable.subscribe("rowClickEvent", function (o) {
        if (o.target.tagName.toLowerCase() != 'a') {
            this.myDataTable.onEventSelectRow);
        }
    });
 
That means, if the target of the event is  not a link, go on an select the row, if it is, do nothing.  The event will eventually bubble out and with nothing to stop it, the link will be followed through.  The problem, I think, is that the onEventSelectRow does a   YAHOO.util.Event.stopEvent(evt); (actually in line 6257) which prevents the event to follow in its tracks.  
 
So, if you actually want the link to be followed, the above solution might be easier.  If you want to do something else with the link, you can listen to linkClickEvent and stop the event propation there.  Nevertheless, stopping the natural propagation of the event would not prevent the loop at _onTbodyClick from carrying on so the rowClickEvent would be triggered as well as all the rest.
 
Give it a try and let us know.  Obrigado
 
Satyam
 
 
 
----- Original Message -----
From: Satyam
Sent: Sunday, September 02, 2007 11:11 PM
Subject: Re: [ydn-javascript] data table formatLink problem

I just checked the source and this has changed from 2.2.2 to 2.3.0 so whatever I recalled from previous versions does not matter.
 
You would have to listen to linkClickEvent, which will fire before rowClickEvent. 
 
 
 
You can see it in datatable-beta.js, search for the method:
 
YAHOO.widget.DataTable.prototype._onTbodyClick
 
and you will see that it loops through all the elements from the one clicked outwards, like bubbling,until ir reaches the <table> element itself. 
 
What I don't know is how to stop it from bubbling all the way up.  If you find out, let us know.
 
Satyam
 
 
 
 
 
 
----- Original Message -----
Sent: Sunday, September 02, 2007 10:31 PM
Subject: Re: [ydn-javascript] data table formatLink problem

Satyam,

Thanks for response!

I am using YUI 2.3.0.

Look my code:

<code>

this.myDataSource = new YAHOO.util.DataSource(uri);
   
 
    this.myDataSource.responseType = YAHOO.util.DataSource.TYPE_TEXT;
   
    this.myDataSource.responseSchema = {
        recordDelim: "|", // Record delimiter
        fieldDelim: ",", // Field delimiter
        fields: ["VIA_TIPO","VIA_TITULO","NOMEVIA","SUBLOTE","NUMERO","BAIRRO","NUM_CEP","DESCRICAO","SITE"]  

    }
   
    var myConfigs = {
                paginated:true,
                paginator: {
                    rowsPerPage: 10,
                    dropdownOptions: [10,20,30,50,100]
                },
                pageLinks: 3
        }
 
    this.myDataTable = new YAHOO.widget.DataTable("basic", myColumnDefs,     this.myDataSource, myConfigs,{caption:"DataTable Consulta",           selectionMode:"single"} );
   
    // Subscribe to events for row selection
        this.myDataTable.subscribe("rowMouseoverEvent", this.myDataTable.onEventHighlightRow);
        this.myDataTable.subscribe("rowMouseoutEvent", this.myDataTable.onEventUnhighlightRow);
        this.myDataTable.subscribe("rowClickEvent", this.myDataTable.onEventSelectRow);


    }

</code>

when not using "row selection" the link in DataTable query result works fine...

I believe to be a bug in Yui DataTable!


Thanks again,


Rodrigo Haas



Satyam <satyam@...> escreveu:
I remember that links didn't work in some old version of YUI, 2.1 or before.  They were fixed, or so I recall, I didn't test them myself, in 2.2 or thereabouts.
 
Satyam
_._,___

Flickr agora em português. Você clica, todo mundo vê. Saiba mais.


No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.484 / Virus Database: 269.13.2/983 - Release Date: 01/09/2007 16:20


No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.484 / Virus Database: 269.13.2/983 - Release Date: 01/09/2007 16:20


No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.484 / Virus Database: 269.13.2/985 - Release Date: 02/09/2007 16:32

#17596 From: "Nagasamudram, Prasanna Kumar" <prasanna.nagasamudram@...>
Date: Mon Sep 3, 2007 8:05 am
Subject: RE: Editable datatable..
prasanna.nagasamudram@...
Send Email Send Email
 

Thanks a lot Satyam….

 

I have a very basic question here….

This solution involves changing the yui code.

 

Is this allowed, I mean are we supposed to give this as a patch and then make use of the new release?

 

Thanks

Prasanna

 

 

 


From: ydn-javascript@yahoogroups.com [mailto:ydn-javascript@yahoogroups.com] On Behalf Of Satyam
Sent: Friday, August 31, 2007 10:38 PM
To: ydn-javascript@yahoogroups.com
Subject: Re: [ydn-javascript] Editable datatable..

 

That is, indeed, a problem.  The best alternative I found is to redefine the saveCellEditor method. 

 

This is how the original looks like, with the original comments stripped and my own added:

 

YAHOO.widget.DataTable.prototype.saveCellEditor = function() {

    if(this._oCellEditor.isActive) {
        var newData = this._oCellEditor.value;
        var oldData = this._oCellEditor.record.getData(this._oCellEditor.column.key);

 

        if(this._oCellEditor.validator) {
            this._oCellEditor.value = this._oCellEditor.validator.call(this, newData, oldData);
            if(this._oCellEditor.value === null ) {

        //  -----  This is what you do on error
                this.resetCellEditor();
                this.fireEvent("editorRevertEvent",
                        {editor:this._oCellEditor, oldData:oldData, newData:newData});
        // ----- up to here
                return;

            }
        }

// ----- This is what you do on success

        this._oRecordSet.updateKey(this._oCellEditor.record, this._oCellEditor.column.key, this._oCellEditor.value);

        this.formatCell(this._oCellEditor.cell);

        this.resetCellEditor();

        this.fireEvent("editorSaveEvent",
                {editor:this._oCellEditor, oldData:oldData, newData:newData});

// ---- up to here.

 


    }
    else {
    }
};

 

So, what I did is to have the part that handles a failed validation made into an inner function, since it will be called in several places.  Where the failure secion is I put a call to this inner function.

 

I cut the 'success' part and save it elsewhere since we are going to use id.  In its place, I put the call to asyncRequest and end the function.  In the success callback to asyncRequest I put the success section I saved. 

 

On the 'failure' callback to asyncRequest I call the failure function, that's why I put it in an inner function.  Actually, even on a sucess return from the server, you have to check if there was any error from the database since the failure callback only handles communication errors, if there are any logic errors, you have to handle those.  In case of error, I call the failure function.  My own is somewhat different, bits and pieces that I added or deleted from the original so I am making this one right here on the message, cutting and pasting and writing here.  It probably doesn't work as is, but I hope it will give you the general idea.  I tried to preserve as much of the original function as possible, even the comments I put in the one above.

 

YAHOO.widget.DataTable.prototype.saveCellEditor = function() {

   // ++++ this is the inner function to handle the several possible failure conditions

    var onFailure = function (msg) {

        alert(msg);
        //  -----  This is what you do on error
           this.resetCellEditor();
           this.fireEvent("editorRevertEvent",
                        {editor:this._oCellEditor, oldData:oldData, newData:newData});

        // ----- up to here
  };

// +++ this comes from the original exdcept for the part I cut to place in the function above.

    if(this._oCellEditor.isActive) {
        var newData = this._oCellEditor.value;
        var oldData = this._oCellEditor.record.getData(this._oCellEditor.column.key);

 

        if(this._oCellEditor.validator) {
            this._oCellEditor.value = this._oCellEditor.validator.call(this, newData, oldData);
            if(this._oCellEditor.value === null ) {

                onFailure('validation');

                return;

            }
        }

 

// ++++++ from here on I added new, except for the 'success' case pasted in.

    YAHOO.util.Connection.asyncRequest('GET','yourURL with newData,fieldname and primary as arguments ',

        {

            success: function (o) {

                if (no error on reply from server) {

                // ----- This is what you do on success

                    this._oRecordSet.updateKey(this._oCellEditor.record, this._oCellEditor.column.key, this._oCellEditor.value);

                    this.formatCell(this._oCellEditor.cell);

                    this.resetCellEditor();

                    this.fireEvent("editorSaveEvent",
                            {editor:this._oCellEditor, oldData:oldData, newData:newData});

                // ---- up to here.

            } else {

                onFailure(o.responseText);

        },

        failure: function(o) {

            onFailure(o.statusText);

        },

        scope: this

    );

 


    }
    else {
    }
};


In my version I don't close the inline editor on error.  The user has either to fix the error (if it is a validation error, client or server side, he can probably fix it) or cancel out of it. 

 

I don't fire the editorRevertEvent and editorSaveEvent since I don't listen to them.  I particularly feel the editorSaveEvent fires too late. That is where you would normally hook for the AJAX call to the server, but the DataTable is already changed and the editor closed as if everything was ok and if there is an error, the user might have already navigated away from the page trusting everything was Ok.  Anyhow, moving that event up doesn't help much since, due to the A in AJAX, you cannot wait in the event for an answer, so the whole thing doesn't quite work. 

 

I also have a Dialog which I use instead of both alert() and confirm(), just for the look and feel. 

 

I also use a POST request instead of GET to allow for large field contents.

 

 

Finally, if you are using JSON, I found that using an 'envelope' in the reply makes things more flexible.  My 'envelope' looks like this:

 

{
    replyCode:200, replyText:"Ok",
    data:[{ ... } , ... ]
}

 

You could do more or less the same thing with XML.  Whichever the message format, make sure to the reply codes are easy to reach.

 

The data element is optional and may contain whatever was requested, but sometimes you just want to know whether it succeeded or not. I use that envelope on all AJAX replies, even those from DataSource to fill the DataTable.   Enclosing the reply in the envelope with the reply code and text is quite handy.  Thus, in the 'success' callback, by simply eval(uating) o.responseText you can easily pick any error messages from the server:

 

            success: function (o) {

                var reply = eval('(' + o.responseText + ')');  // better enclose this in a try-catch to handle possible errors

                if (r.replyCode == 200 ) {

 

                } else {

                    onFailure(r.replyText);

                }

 

Just like in HTTP I use 200 to indicate Ok, 2xx for mostly ok, 5xx for errors.

 

Are you using PHP on the server side?  Then check:  http://www.satyam.com.ar/int/PhpJson.htm

 

 

Wish you luck!

 

Satyam

----- Original Message -----

Sent: Friday, August 31, 2007 2:55 PM

Subject: RE: [ydn-javascript] Editable datatable..

 

Hi Satyam

 

 

Previous requirement was a confirmation before saving the data.

Tha following solves the problem as you mentioned.

editor:"textbox",editorOptions:{validator:function(oData){
     if (confirm('do you want to save?')) return oData;
     return null;
    }}

 

But now instead of a confirmation, I need to send and AJAX request.

One I get the AJAX response I should save the data.

 

But since AJAX is asynchronous and the handler is a different function, can I make the validator wait for the AJAX response?

So that it can reurn oData or null appropriately …….

 

Thanks

Prasanna

 


From: ydn-javascript@yahoogroups.com [mailto:ydn-javascript@yahoogroups.com] On Behalf Of Nagasamudram, Prasanna Kumar
Sent: Tuesday, August 28, 2007 6:36 PM
To: ydn-javascript@yahoogroups.com
Subject: RE: [ydn-javascript] Editable datatable..

 

Im sorry , I meant validator and not formatter.

 

Also, I was trying to use YAHOO.widget.Dialog instead of using the javascript “confirm”.

 

That solves my problem…

 

Thanks a lot

 

Prasanna

 

 

 


From: ydn-javascript@yahoogroups.com [mailto:ydn-javascript@yahoogroups.com] On Behalf Of Satyam
Sent: Tuesday, August 28, 2007 5:44 PM
To: ydn-javascript@yahoogroups.com
Subject: Re: [ydn-javascript] Editable datatable..

 

I'm a little confused, Formatter?  that's used for displaying, I was talking about the validator.. 

 

Anyway, here is a little sample code that works and I hope will explain itself, just add the following to the column definition of any column you want to have further confirmation before saving:

 

editor:"textbox",editorOptions:{validator:function(oData){
     if (confirm('do you want to save?')) return oData;
     return null;
    }}

 

Satyam

 

----- Original Message -----

Sent: Tuesday, August 28, 2007 1:22 PM

Subject: RE: [ydn-javascript] Editable datatable..

 

Hi Satyam

 

I was able to catch the moment when the editor is about to save the data, where I will display a dialog box, which says “do you want to really commit?”, clicking on yes I can call the savecellEditor.

 

But my problem is say we have the following

 

 

Formatter

{

            callDialog()

            return something based on the dialog or the flag

}

 

 

callDialog()

{

 

            handleOK {   saveCellEditor() or may be set a flag}

            handleCANCEL { do Nothing}

 

}

 

 

By the time I click on the OK button of the dialog box, Formatter should have done its job of displaying the dialog box, but has nothing to return.

 

 

Thanks

Prasanna

 


From: ydn-javascript@yahoogroups.com [mailto:ydn-javascript@yahoogroups.com] On Behalf Of Satyam
Sent: Friday, August 17, 2007 2:21 PM
To: ydn-javascript@yahoogroups.com
Subject: Re: [ydn-javascript] Editable datatable..

 

A good place to do this would be to assign a validator function to the columns you will edit such that if the user confirms, you return the received value (first argument, newData) indicating it validated Ok, otherwise, you return null and the validation will fail. 

 

See the method:

 

YAHOO.widget.DataTable.prototype.saveCellEditor 

 

in datatable-beta.js and you will see how it would work. I think it is the least intrusive way to do what you are asking for.  This method is called to save the data for any cell editor, whichever way the user ends the inline editing and the call to:

 

this._oCellEditor.validator.call(this, newData, oldData);

 

is a good place to catch the right moment.

 

Satyam

 

 

 

----- Original Message -----

Sent: Friday, August 17, 2007 10:25 AM

Subject: [ydn-javascript] Editable datatable..

 

Hi

 

 

I have seen the sample that displays a text box when a particular cell in a data table is clicked.

 

When the uses modifies the text and presses the ENTER key the data is saved and is reflected on the fly.

 

I want to catch this ENTER key and display a confirmation dialog box , if the user presses OK then I need to call a function before saving the data.

 

Can you please let me know how to catch this ENTER key.

 

 

 

Thanks

Prasanna


size=2 width="100%" align=center>

No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.484 / Virus Database: 269.12.0/957 - Release Date: 16/08/2007 13:46


size=2 width="100%" align=center>

No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.484 / Virus Database: 269.12.10/976 - Release Date: 27/08/2007 18:20


size=2 width="100%" align=center>

No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.484 / Virus Database: 269.13.0/980 - Release Date: 30/08/2007 18:05


#17597 From: "Satyam" <satyam@...>
Date: Mon Sep 3, 2007 8:32 am
Subject: Re: Editable datatable..
satyamutsa
Send Email Send Email
 
It is better that you don't change the original distribution files, I did that once and when the update came, it was tough to check the changes. 
 
What I now have is a separate file with all my patches that I load after the file to be patched so that its definitions overwrite the original ones.  That makes it easy when a new version comes to pick the methods that were patched and check if they are still necesary.
 
I actually have my own customized version of DataTable (using YAHOO.lang.extend) where I have several of the basic settings already taken care of and I can redefine the methods in that inherited DataTable.  If there were to be any licensing issues with modifying the original library, this would take care of them. 
 
Anyway, redefining the original or your inherited version makes no difference when update time comes, you'll have to check those patches anyway, so it is good to have them all in one place. 
 
Satyam
 
----- Original Message -----
Sent: Monday, September 03, 2007 10:05 AM
Subject: RE: [ydn-javascript] Editable datatable..

Thanks a lot Satyam….

 

I have a very basic question here….

This solution involves changing the yui code.

 

Is this allowed, I mean are we supposed to give this as a patch and then make use of the new release?

 

Thanks

Prasanna

 

 

 


From: ydn-javascript@yahoogroups.com [mailto:ydn-javascript@yahoogroups.com] On Behalf Of Satyam
Sent: Friday, August 31, 2007 10:38 PM
To: ydn-javascript@yahoogroups.com
Subject: Re: [ydn-javascript] Editable datatable..

 

That is, indeed, a problem.  The best alternative I found is to redefine the saveCellEditor method. 

 

This is how the original looks like, with the original comments stripped and my own added:

 

YAHOO.widget.DataTable.prototype.saveCellEditor = function() {

    if(this._oCellEditor.isActive) {
        var newData = this._oCellEditor.value;
        var oldData = this._oCellEditor.record.getData(this._oCellEditor.column.key);

 

        if(this._oCellEditor.validator) {
            this._oCellEditor.value = this._oCellEditor.validator.call(this, newData, oldData);
            if(this._oCellEditor.value === null ) {

        //  -----  This is what you do on error
                this.resetCellEditor();
                this.fireEvent("editorRevertEvent",
                        {editor:this._oCellEditor, oldData:oldData, newData:newData});
        // ----- up to here
                return;

            }
        }

// ----- This is what you do on success

        this._oRecordSet.updateKey(this._oCellEditor.record, this._oCellEditor.column.key, this._oCellEditor.value);

        this.formatCell(this._oCellEditor.cell);

        this.resetCellEditor();

        this.fireEvent("editorSaveEvent",
                {editor:this._oCellEditor, oldData:oldData, newData:newData});

// ---- up to here.

 


    }
    else {
    }
};

 

So, what I did is to have the part that handles a failed validation made into an inner function, since it will be called in several places.  Where the failure secion is I put a call to this inner function.

 

I cut the 'success' part and save it elsewhere since we are going to use id.  In its place, I put the call to asyncRequest and end the function.  In the success callback to asyncRequest I put the success section I saved. 

 

On the 'failure' callback to asyncRequest I call the failure function, that's why I put it in an inner function.  Actually, even on a sucess return from the server, you have to check if there was any error from the database since the failure callback only handles communication errors, if there are any logic errors, you have to handle those.  In case of error, I call the failure function.  My own is somewhat different, bits and pieces that I added or deleted from the original so I am making this one right here on the message, cutting and pasting and writing here.  It probably doesn't work as is, but I hope it will give you the general idea.  I tried to preserve as much of the original function as possible, even the comments I put in the one above.

 

YAHOO.widget.DataTable.prototype.saveCellEditor = function() {

   // ++++ this is the inner function to handle the several possible failure conditions

    var onFailure = function (msg) {

        alert(msg);
        //  -----  This is what you do on error
           this.resetCellEditor();
           this.fireEvent("editorRevertEvent",
                        {editor:this._oCellEditor, oldData:oldData, newData:newData});

        // ----- up to here
  };

// +++ this comes from the original exdcept for the part I cut to place in the function above.

    if(this._oCellEditor.isActive) {
        var newData = this._oCellEditor.value;
        var oldData = this._oCellEditor.record.getData(this._oCellEditor.column.key);

 

        if(this._oCellEditor.validator) {
            this._oCellEditor.value = this._oCellEditor.validator.call(this, newData, oldData);
            if(this._oCellEditor.value === null ) {

                onFailure('validation');

                return;

            }
        }

 

// ++++++ from here on I added new, except for the 'success' case pasted in.

    YAHOO.util.Connection.asyncRequest('GET','yourURL with newData,fieldname and primary as arguments ',

        {

            success: function (o) {

                if (no error on reply from server) {

                // ----- This is what you do on success

                    this._oRecordSet.updateKey(this._oCellEditor.record, this._oCellEditor.column.key, this._oCellEditor.value);

                    this.formatCell(this._oCellEditor.cell);

                    this.resetCellEditor();

                    this.fireEvent("editorSaveEvent",
                            {editor:this._oCellEditor, oldData:oldData, newData:newData});

                // ---- up to here.

            } else {

                onFailure(o.responseText);

        },

        failure: function(o) {

            onFailure(o.statusText);

        },

        scope: this

    );

 


    }
    else {
    }
};


In my version I don't close the inline editor on error.  The user has either to fix the error (if it is a validation error, client or server side, he can probably fix it) or cancel out of it. 

 

I don't fire the editorRevertEvent and editorSaveEvent since I don't listen to them.  I particularly feel the editorSaveEvent fires too late. That is where you would normally hook for the AJAX call to the server, but the DataTable is already changed and the editor closed as if everything was ok and if there is an error, the user might have already navigated away from the page trusting everything was Ok.  Anyhow, moving that event up doesn't help much since, due to the A in AJAX, you cannot wait in the event for an answer, so the whole thing doesn't quite work. 

 

I also have a Dialog which I use instead of both alert() and confirm(), just for the look and feel. 

 

I also use a POST request instead of GET to allow for large field contents.

 

 

Finally, if you are using JSON, I found that using an 'envelope' in the reply makes things more flexible.  My 'envelope' looks like this:

 

{
    replyCode:200, replyText:"Ok",
    data:[{ ... } , ... ]
}

 

You could do more or less the same thing with XML.  Whichever the message format, make sure to the reply codes are easy to reach.

 

The data element is optional and may contain whatever was requested, but sometimes you just want to know whether it succeeded or not. I use that envelope on all AJAX replies, even those from DataSource to fill the DataTable.   Enclosing the reply in the envelope with the reply code and text is quite handy.  Thus, in the 'success' callback, by simply eval(uating) o.responseText you can easily pick any error messages from the server:

 

            success: function (o) {

                var reply = eval('(' + o.responseText + ')');  // better enclose this in a try-catch to handle possible errors

                if (r.replyCode == 200 ) {

 

                } else {

                    onFailure(r.replyText);

                }

 

Just like in HTTP I use 200 to indicate Ok, 2xx for mostly ok, 5xx for errors.

 

Are you using PHP on the server side?  Then check:  http://www.satyam.com.ar/int/PhpJson.htm

 

 

Wish you luck!

 

Satyam

----- Original Message -----

Sent: Friday, August 31, 2007 2:55 PM

Subject: RE: [ydn-javascript] Editable datatable..

 

Hi Satyam

 

 

Previous requirement was a confirmation before saving the data.

Tha following solves the problem as you mentioned.

editor:"textbox",editorOptions:{validator:function(oData){
     if (confirm('do you want to save?')) return oData;
     return null;
    }}

 

But now instead of a confirmation, I need to send and AJAX request.

One I get the AJAX response I should save the data.

 

But since AJAX is asynchronous and the handler is a different function, can I make the validator wait for the AJAX response?

So that it can reurn oData or null appropriately …….

 

Thanks

Prasanna

 


From: ydn-javascript@yahoogroups.com [mailto:ydn-javascript@yahoogroups.com] On Behalf Of Nagasamudram, Prasanna Kumar
Sent: Tuesday, August 28, 2007 6:36 PM
To: ydn-javascript@yahoogroups.com
Subject: RE: [ydn-javascript] Editable datatable..

 

Im sorry , I meant validator and not formatter.

 

Also, I was trying to use YAHOO.widget.Dialog instead of using the javascript “confirm”.

 

That solves my problem…

 

Thanks a lot

 

Prasanna

 

 

 


From: ydn-javascript@yahoogroups.com [mailto:ydn-javascript@yahoogroups.com] On Behalf Of Satyam
Sent: Tuesday, August 28, 2007 5:44 PM
To: ydn-javascript@yahoogroups.com
Subject: Re: [ydn-javascript] Editable datatable..

 

I'm a little confused, Formatter?  that's used for displaying, I was talking about the validator.. 

 

Anyway, here is a little sample code that works and I hope will explain itself, just add the following to the column definition of any column you want to have further confirmation before saving:

 

editor:"textbox",editorOptions:{validator:function(oData){
     if (confirm('do you want to save?')) return oData;
     return null;
    }}

 

Satyam

 

----- Original Message -----

Sent: Tuesday, August 28, 2007 1:22 PM

Subject: RE: [ydn-javascript] Editable datatable..

 

Hi Satyam

 

I was able to catch the moment when the editor is about to save the data, where I will display a dialog box, which says “do you want to really commit?”, clicking on yes I can call the savecellEditor.

 

But my problem is say we have the following

 

 

Formatter

{

            callDialog()

            return something based on the dialog or the flag

}

 

 

callDialog()

{

 

            handleOK {   saveCellEditor() or may be set a flag}

            handleCANCEL { do Nothing}

 

}

 

 

By the time I click on the OK button of the dialog box, Formatter should have done its job of displaying the dialog box, but has nothing to return.

 

 

Thanks

Prasanna

 


From: ydn-javascript@yahoogroups.com [mailto:ydn-javascript@yahoogroups.com] On Behalf Of Satyam
Sent: Friday, August 17, 2007 2:21 PM
To: ydn-javascript@yahoogroups.com
Subject: Re: [ydn-javascript] Editable datatable..

 

A good place to do this would be to assign a validator function to the columns you will edit such that if the user confirms, you return the received value (first argument, newData) indicating it validated Ok, otherwise, you return null and the validation will fail. 

 

See the method:

 

YAHOO.widget.DataTable.prototype.saveCellEditor 

 

in datatable-beta.js and you will see how it would work. I think it is the least intrusive way to do what you are asking for.  This method is called to save the data for any cell editor, whichever way the user ends the inline editing and the call to:

 

this._oCellEditor.validator.call(this, newData, oldData);

 

is a good place to catch the right moment.

 

Satyam

 

 

 

----- Original Message -----

Sent: Friday, August 17, 2007 10:25 AM

Subject: [ydn-javascript] Editable datatable..

 

Hi

 

 

I have seen the sample that displays a text box when a particular cell in a data table is clicked.

 

When the uses modifies the text and presses the ENTER key the data is saved and is reflected on the fly.

 

I want to catch this ENTER key and display a confirmation dialog box , if the user presses OK then I need to call a function before saving the data.

 

Can you please let me know how to catch this ENTER key.

 

 

 

Thanks

Prasanna


size=2 width="100%" align=center>

No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.484 / Virus Database: 269.12.0/957 - Release Date: 16/08/2007 13:46


size=2 width="100%" align=center>

No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.484 / Virus Database: 269.12.10/976 - Release Date: 27/08/2007 18:20


size=2 width="100%" align=center>

No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.484 / Virus Database: 269.13.0/980 - Release Date: 30/08/2007 18:05


No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.484 / Virus Database: 269.13.2/985 - Release Date: 02/09/2007 16:32

#17598 From: "Satyam" <satyam@...>
Date: Mon Sep 3, 2007 8:35 am
Subject: Re: data table formatLink problem
satyamutsa
Send Email Send Email
 
Finally, forget about all those replies, I shouldn't be checking my mail past midnight.  This works, I have just tested it:
 
   this.myDataTable.subscribe("linkClickEvent", function(o) {
    location.href = o.target.href;
   });
 
Satyam
 
 
----- Original Message -----
From: Satyam
Sent: Monday, September 03, 2007 9:14 AM
Subject: Re: [ydn-javascript] data table formatLink problem

There is a typo in the code below, the line within the conditional should be:
 
            this.myDataTable.onEventSelectRow(o);
 
----- Original Message -----
From: Satyam
Sent: Monday, September 03, 2007 1:06 AM
Subject: Re: [ydn-javascript] data table formatLink problem

I think I have a better one.  Change this line:
 
     this.myDataTable.subscribe("rowClickEvent", this.myDataTable.onEventSelectRow);
 
to this:
 
     this.myDataTable.subscribe("rowClickEvent", function (o) {
        if (o.target.tagName.toLowerCase() != 'a') {
            this.myDataTable.onEventSelectRow);
        }
    });
 
That means, if the target of the event is  not a link, go on an select the row, if it is, do nothing.  The event will eventually bubble out and with nothing to stop it, the link will be followed through.  The problem, I think, is that the onEventSelectRow does a   YAHOO.util.Event.stopEvent(evt); (actually in line 6257) which prevents the event to follow in its tracks.  
 
So, if you actually want the link to be followed, the above solution might be easier.  If you want to do something else with the link, you can listen to linkClickEvent and stop the event propation there.  Nevertheless, stopping the natural propagation of the event would not prevent the loop at _onTbodyClick from carrying on so the rowClickEvent would be triggered as well as all the rest.
 
Give it a try and let us know.  Obrigado
 
Satyam
 
 
 
----- Original Message -----
From: Satyam
Sent: Sunday, September 02, 2007 11:11 PM
Subject: Re: [ydn-javascript] data table formatLink problem

I just checked the source and this has changed from 2.2.2 to 2.3.0 so whatever I recalled from previous versions does not matter.
 
You would have to listen to linkClickEvent, which will fire before rowClickEvent. 
 
 
 
You can see it in datatable-beta.js, search for the method:
 
YAHOO.widget.DataTable.prototype._onTbodyClick
 
and you will see that it loops through all the elements from the one clicked outwards, like bubbling,until ir reaches the <table> element itself. 
 
What I don't know is how to stop it from bubbling all the way up.  If you find out, let us know.
 
Satyam
 
 
 
 
 
 
----- Original Message -----
Sent: Sunday, September 02, 2007 10:31 PM
Subject: Re: [ydn-javascript] data table formatLink problem

Satyam,

Thanks for response!

I am using YUI 2.3.0.

Look my code:

<code>

this.myDataSource = new YAHOO.util.DataSource(uri);
   
 
    this.myDataSource.responseType = YAHOO.util.DataSource.TYPE_TEXT;
   
    this.myDataSource.responseSchema = {
        recordDelim: "|", // Record delimiter
        fieldDelim: ",", // Field delimiter
        fields: ["VIA_TIPO","VIA_TITULO","NOMEVIA","SUBLOTE","NUMERO","BAIRRO","NUM_CEP","DESCRICAO","SITE"]  

    }
   
    var myConfigs = {
                paginated:true,
                paginator: {
                    rowsPerPage: 10,
                    dropdownOptions: [10,20,30,50,100]
                },
                pageLinks: 3
        }
 
    this.myDataTable = new YAHOO.widget.DataTable("basic", myColumnDefs,     this.myDataSource, myConfigs,{caption:"DataTable Consulta",           selectionMode:"single"} );
   
    // Subscribe to events for row selection
        this.myDataTable.subscribe("rowMouseoverEvent", this.myDataTable.onEventHighlightRow);
        this.myDataTable.subscribe("rowMouseoutEvent", this.myDataTable.onEventUnhighlightRow);
        this.myDataTable.subscribe("rowClickEvent", this.myDataTable.onEventSelectRow);


    }

</code>

when not using "row selection" the link in DataTable query result works fine...

I believe to be a bug in Yui DataTable!


Thanks again,


Rodrigo Haas



Satyam <satyam@...> escreveu:
I remember that links didn't work in some old version of YUI, 2.1 or before.  They were fixed, or so I recall, I didn't test them myself, in 2.2 or thereabouts.
 
Satyam
_._,___

Flickr agora em português. Você clica, todo mundo vê. Saiba mais.


No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.484 / Virus Database: 269.13.2/983 - Release Date: 01/09/2007 16:20


No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.484 / Virus Database: 269.13.2/983 - Release Date: 01/09/2007 16:20


No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.484 / Virus Database: 269.13.2/985 - Release Date: 02/09/2007 16:32


No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.484 / Virus Database: 269.13.2/985 - Release Date: 02/09/2007 16:32

#17599 From: "andrew.bykov" <andrew.bykov@...>
Date: Mon Sep 3, 2007 9:08 am
Subject: YUI rich editor - hide toolbar at all
andrew.bykov
Send Email Send Email
 
Hi!

Please clarify me - how I can completely hide the YUI rich edit
toolbar, or at least it's buttons panel only?

If it's impossible, can I emulate "collapse" event fire on startup or
implement other trick to hide toolbar?

I've tried to call Toolbar.destroy() method, or copy javascript code
from "toolbarCollapsed" event handler to my handler but this tricks
doesn't works..

Thanks!

Best regards,
Andrew

Messages 17568 - 17599 of 52481   Oldest  |  < Older  |  Newer >  |  Newest
Add to My Yahoo!      XML What's This?

Copyright © 2010 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines NEW - Help