Loading ...
Sorry, an error occurred while loading the content.

Re: DataTable Formating

Expand Messages
  • mikepaim
    ... has no ... wrong. The ... syntax ... be. ... should look ... good to ... Same with ... sign. ... the ... formatted ... the ... add width= 30 ... dom-
    Message 1 of 3 , Jan 4, 2008
    • 0 Attachment
      --- In ydn-javascript@yahoogroups.com, "Satyam" <satyam@...> wrote:
      >
      > The code you show is just the example from the documentation, it
      has no
      > className or width so I can hardly know what it is you are doing
      wrong. The
      > only hint I have is that you say "width="30"" which is a pretty big
      syntax
      > error, but since you are quoting, loosely, I hope, that shouldn't
      be.
      > Anyway, just in case, anything you add to the column definitions
      should look
      > like width:"30px" not with an equal sign but with a colon and it is
      good to
      > explicitly state the units you are using, pixels in this case.
      Same with
      > the className, names and values separated by colon, not an equal
      sign.
      >
      > Satyam
      >
      > ----- Original Message -----
      > From: "mikepaim" <mikepaim@...>
      > To: <ydn-javascript@yahoogroups.com>
      > Sent: Friday, January 04, 2008 3:42 PM
      > Subject: [ydn-javascript] DataTable Formating
      >
      >
      > > Hello. I'm new to YUI and started by re-creating the example on
      the
      > > following page:
      > > http://com3.devnet.re3.yahoo.com/yui/datatable/
      > >
      > > I can view the data, no problem. However, the table is not
      formatted
      > > well. I've tried adding the "width" or "className" attributes to
      the
      > > myColumnDefs but nothing's working. In fact, when I
      add "width="30""
      > > for example, all the data on the page stops displaying.
      > >
      > > What am I doing wrong?
      > >
      > > Here's my code:
      > >
      > > <!-- Dependencies -->
      > > <script type="text/javascript"
      > > src="http://yui.yahooapis.com/2.4.1/build/yahoo-dom-event/yahoo-
      dom-
      > > event.js"></script>
      > > <script type="text/javascript"
      > > src="http://yui.yahooapis.com/2.4.1/build/element/element-beta-
      > > min.js"></script>
      > > <script type="text/javascript"
      > > src="http://yui.yahooapis.com/2.4.1/build/datasource/datasource-
      beta-
      > > min.js"></script>
      > >
      > > <!-- 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.4.1/build/connection/connection-
      > > min.js"></script>
      > >
      > > <!-- OPTIONAL: Drag Drop (enables resizeable columns) -->
      > > <script type="text/javascript"
      > > src="http://yui.yahooapis.com/2.4.1/build/dragdrop/dragdrop-
      > > min.js"></script>
      > >
      > > <!-- OPTIONAL: Calendar (enables calendar editors) -->
      > > <script type="text/javascript"
      > > src="http://yui.yahooapis.com/2.4.1/build/calendar/calendar-
      > > min.js"></script>
      > >
      > > <!-- Source files -->
      > > <script type="text/javascript"
      > > src="http://yui.yahooapis.com/2.4.1/build/datatable/datatable-
      beta-
      > > min.js"></script>
      > >
      > > <body>
      > >
      > > <div id="myContainer"></div>
      > >
      > >
      > > <script type="text/javascript">
      > > YAHOO.example.puppies = [
      > > {name:"Ashley",breed:"German Shepherd",age:12},
      > > {name:"Dirty Harry",breed:"Norwich Terrier",age:5},
      > > {name:"Abby",breed:"Labrador Retriever",age:9},
      > > {name:"Oscar",breed:"Yorkshire Terrier",age:6},
      > > {name:"Riley",breed:"Golden Retriever",age:6},
      > > {name:"Bob",breed:"Miniature Schnauzer",age:8},
      > > {name:"Shannon",breed:"Greyhound",age:12},
      > > {name:"Brandy",breed:"Boxer",age:8},
      > > {name:"Zoe",breed:"Labrador Retriever",age:3}
      > > ];
      > >
      > > var myDataSource = new YAHOO.util.DataSource
      (YAHOO.example.puppies);
      > > myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSARRAY;
      > > myDataSource.responseSchema = {
      > > fields: ["name","breed","age"]
      > > };
      > >
      > > var myColumnDefs = [
      > > {key:"name", label:"Dog's Name"},
      > > {key:"breed", label:"Dog's Breed"},
      > > {key:"age", label:"Dog's Age (in Weeks)"}
      > > ];
      > >
      > >
      > > var myDataTable = new YAHOO.widget.DataTable("myContainer",
      > > myColumnDefs, myDataSource);
      > >
      > > </script>
      > > <span class="mystyle">hello</span>
      > > </body>
      > > </html>
      > >
      > > Thanks,
      > > Michael
      > >
      > >
      > >
      > >
      > > Yahoo! Groups Links
      > >
      > >
      > >
      > >
      > >
      > > --
      > > No virus found in this incoming message.
      > > Checked by AVG Free Edition.
      > > Version: 7.5.516 / Virus Database: 269.17.13/1208 - Release Date:
      > > 03/01/2008 15:52
      > >
      > >
      >

      Satyam,

      That was it. I think it was the = sign that caused the problem. I
      thought I tried a colon as well and it didn't work. In any case, it's
      working now.

      THANKS!
      Michael
    Your message has been successfully submitted and would be delivered to recipients shortly.