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

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

Expand Messages
  • Satyam
    Jan 13, 2010
    • 0 Attachment


      El 13/01/2010 15:17, vino ben escribió:
      Hi Satyam,

      The grid is very complicated to host it in a public server with real data and then too, the bug might or might not replicate. 

      From your previous response ,

      => " You shouldn't try to do anything on the datatable until it signals you that it is ready "

      Can we capture this by any event ? so that I can invoke my custom logic ON this event(after the table is ready)
      [ If this can be done myday is saved]
      initEvent the first time around, renderEvent on any rendering, which includes sorting.  There are plenty of events, some of them 'before' and 'after' or 'post' events, I doubt there is anything in the datatable that has no event associated.

      => "I don't know why would you care to do any sort of bulk formatting afterwards while you can do it on the fly."

      This seems to be a valid way out for me ( but a long way)..

      I Tried to accomodate these logics in ROWFORMATTER and since I found it complicated at that stage
      I went by this approach ( I used a lot of datatable methods which would not be possible in formatters).

      Now, it seems that it is better off to take pains and accomodate them in cusotm cell and rowformatters
      rather than living with a weird bug hidden inside.
      ( I'm half done with these changes now...)

      Thanks a ton for the valuable leads you are providing us to make the whole YUI developers experience better worldwide.

      Regards,
      Vinoth


      From: Satyam <satyam@...>
      To: ydn-javascript@yahoogroups.com
      Sent: Tue, January 12, 2010 7:44:38 PM
      Subject: Re: [ydn-javascript] Datatable inline cell editor fails @ times

       

      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.

      Satyam

      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. ScrollingDataTab le("yuifincodesc ontainer" , myColumnDefs, myDataSource, {width:"95%" , height:"20em" ,formatRow: myRowFormatter} );

             datatablePostFormat ting();

             // Followed by 
              myDataTable. subscribe( "cellMouseoverEv ent", highlightEditableCe ll);
              myDataTable. subscribe( "cellMouseoutEve nt", myDataTable. onEventUnhighlig htCell);
              myDataTable. subscribe( "cellClickEvent" , function (oArgs){});
      myDataTable. subscribe( 'editorSaveEvent ', function(oArgs) {});

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

      Thanks & Regards,
      Vinoth



      From: Satyam <satyam@satyam. com.ar>
      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.

      Satyam

      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

       

      Hi,

      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.

      Regards,
      Vinoth


      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

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