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

52354Re: [ydn-javascript] Datatable inline cell editor fails @ times

Expand Messages
  • Satyam
    Jan 12, 2010
    • 0 Attachment
      Honestly, I can't but just theorize about all this because I can't see what are we talking about.

      If you could place a WORKING sample somewhere public so I can see it work, this could be solved in no time.

      Something I can tell you is that if that formatter is called straight after instantiating the datatable and if the data source is remote, it will produce random results, which is what you are experiencing.  The datatable might or might not be build by then, or it might be partially ready, most likely, it won't be at all.  You shouldn't try to do anything on the datatable until it signals you that it is ready and, at any rate, I don't know why would you care to do any sort of bulk formatting afterwards while you can do it on the fly.


      El 12/01/2010 14:22, vino ben escribió:
      Hi Satyam,

          Thanks very much for the leads. I have tried the tests that you had suggested.

          1) Used YUI logger and included datasource and datatable in debug mode 

              - There are no WARN messages
          2) Loaded the page in firefox with firebug 

             - Interestingly the bug isnt occuring in firefox ( Is this some sort of a clue ?)

          3) Installed JSLint in my IDE and checked for all warnings and JSLint did not report anything suspicious.

               I might be going wrong somewhere in JSLint settings. ( I'm working on this )

          To add to this..

          * I use a custom editor (Text with Autocomplete) which I extend from textBox cell editor. Would this have something going wrong ? ( JSLint does not complain about anything here)
          * I have custom formatting logic which I perform immediately after the datatable constructor. And all subscribers after this...
             Will this be of any impact ?. Should I be having all the subscribers immediately after the constructor and not after the custom formats ?

             myDataTable = new YAHOO.widget.ScrollingDataTable("yuifincodescontainer", myColumnDefs, myDataSource, {width:"95%", height:"20em",formatRow: myRowFormatter});


             // Followed by 
              myDataTable.subscribe("cellMouseoverEvent", highlightEditableCell);
              myDataTable.subscribe("cellMouseoutEvent", myDataTable.onEventUnhighlightCell);
              myDataTable.subscribe("cellClickEvent", function (oArgs){});
      myDataTable.subscribe('editorSaveEvent', function(oArgs) {});

             - Becuase I noticed some TimeOut phrase being used in the datatable js

      Thanks & Regards,

      From: Satyam <satyam@...>
      To: ydn-javascript@yahoogroups.com
      Sent: Fri, January 8, 2010 8:57:17 PM
      Subject: Re: [ydn-javascript] Datatable inline cell editor fails @ times


      That is usually some initialization code that fails under certain circumstances and the DataTable doesn't get fully initialized.  

      For those mysterious errors, the steps to clean them is, run JSLint on the code and pay attention to all its warnings, even harmless unused variables might point to misspellings, you declared it one way and never used it because you used it with another name elsewhere.  All YUI code gets zero errors in JSLint and this is very large and complex code base, nevertheless, it reaches you clean of errors. 

      If you are using JSON, use JSONLint to see if it is valid.  Don't use a hand-coded JSON encoder on the server, there are some subtleties with the encoding of characters beyond the normal US-ASCII and in a particular query you get one record containing such character, it will break.

      Load -debug versions of the relevant components (DataSource, DataTable) and add a Logger to your page.  If you see any message in red, that's it.

      Install Firefox with the Firebug debugger.  Run the program with the debugger active to Break on All Errors, that's the name of the option.

      Don't trouble yourself with debugging after you cleaned it up with JSLint.   You can search for all this in the web.


      El 08/01/2010 15:29, vino ben escribió:

      In my below post ,

      what i meant by datatable renders non editable is - 

      Editable cells - do not respond to mouseover and cellClickevents

      From: vino_gallantguy <vino_gallantguy@ yahoo.co. in>
      To: ydn-javascript@ yahoogroups. com
      Sent: Fri, January 8, 2010 6:26:50 PM
      Subject: [ydn-javascript] Datatable inline cell editor fails @ times



      I have a weird issue with yui datatable. I generate a datatable with editable and non editable fields.

      -> Sometimes the whole datagrid renders non editable. And now if I try a few F5s it renders fine as editable

      This is pretty baffling as I do not know where and what to debug for. Please help me out of this mess.

      I use YUI2.7 and IE7 and a scrolling datatable.

      This is how I instantiate the table :
      myDataTable = new YAHOO.widget. ScrollingDataTab le("container" , myColumnDefs, myDataSource, {width:"95%" , height:"20em" ,formatRow: myRowFormatter} );

      Is this some sort of a bug ? Has anyone faced a similar issue before?

      Please suggest.


      No virus found in this incoming message. Checked by AVG - www.avg.com Version: 9.0.725 / Virus Database: 270.14.129/2606 - Release Date: 01/07/10 20:35:00

      No virus found in this incoming message. Checked by AVG - www.avg.com Version: 9.0.725 / Virus Database: 270.14.135/2615 - Release Date: 01/11/10 20:35:00
    • Show all 7 messages in this topic