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

Re: [ydn-javascript] Re: Datatable destroy

Expand Messages
  • Satyam
    You still have full control over the container of the DataTable. You can set the style of the container to container.style.display = none to hide the
    Message 1 of 6 , May 3 12:40 PM
    • 0 Attachment
      You still have full control over the container of the DataTable. You can
      set the style of the container to container.style.display = 'none' to hide
      the container and everything within and back to 'block' when you want to
      show it again.

      Satyam

      ----- Original Message -----
      From: "myworld100us" <myworld100us@...>
      To: <ydn-javascript@yahoogroups.com>
      Sent: Saturday, May 03, 2008 8:05 PM
      Subject: [ydn-javascript] Re: Datatable destroy


      > Yes , you were right . In the sendRequest , I just to have a blank
      > parameter there . That worked.
      >
      > On the Same lines , One More issue . Is this possible . I dont want
      > to show these tables unless they click on a button .[Which Says Show
      > Details].
      >
      > What happens is ?
      >
      > 1. I load the Parent Table
      > 2. User Clicks on One row of the Parent Table , then he clicks on
      > the show button , I display the table .
      > 3. If the User switches the row , the old child Tables [which were
      > populated based on the original row is still exists] AS I dont call
      > the destroy .I dont want to display those tables there now .
      >
      >
      > Is there a solution for this ?
      >
      >
      >
      >
      >
      >
      > --- In ydn-javascript@yahoogroups.com, "Satyam" <satyam@...> wrote:
      >>
      >> It seems to me you are concatenating regkey twice into the URL:
      >>
      >> ®Key=regKey=value
      >>
      >> You could check that if you are using Firebug in the Net tab,
      > check for the
      >> actual URL you are sending.
      >>
      >> Satyam
      >>
      >> ----- Original Message -----
      >> From: "myworld100us" <myworld100us@...>
      >> To: <ydn-javascript@yahoogroups.com>
      >> Sent: Friday, May 02, 2008 11:41 PM
      >> Subject: [ydn-javascript] Re: Datatable destroy
      >>
      >>
      >> > Satyam,
      >> >
      >> > Thanks for ur input.
      >> > I tried to take ur solution . But What happens is For the first
      > time
      >> > the datatable gets
      >> > painted correctly , but next time (i.e) when I call send Request
      >> > The Server does not identify the QueryString and I get back No
      >> > Records as the top row
      >> > on the existing Datatable . The old rows are still present .
      > This is
      >> > how my code looks
      >> >
      >> > First I had written a generic method loadDrugTable(regKey)
      >> >
      >> > function loadDrugTable(regKey)
      >> > {
      >> >
      >> > var wrkColHeader = [
      >> > {key:"regKey", label:"Regimen Key" ,
      >> > wdith:"2em"},
      >> > {key:"drugId", label:"Reg Drug Xref ID"},
      >> > {key:'drugDel', label:'Delete',
      >> > formatter:YAHOO.widget.DataTable.formatCheckbox
      >> > },
      >> > {key:"catGroupId", label:"Cat Group Desc",
      >> > formatter:formatDropdown, dropdownOptions:catGroupDescArray},
      >> > {key:"drugDosingDesc", label:"Drug Dosing
      > desc",
      >> > editor:this.editNewDesc},
      >> > {key:"drugDosingSize", label:"Drug Dosing
      >> > Size" , editor:this.editSize},
      >> > {key:"drugDosingUom",
      >> > label:"Drug Dosing UOM ", formatter:formatDropdown,
      >> > dropdownOptions:drugUomArray},
      >> > {key:'dosingPer', label:'
      >> > Per', formatter:formatDropdown, dropdownOptions:[
      >> > {value:'M2',
      >> > text:'M2'},
      >> >
      >> > {value:'Day', text:'Day'},
      >> > {value:'Kg',
      >> > text:'Kg'},
      >> > {value:'flat
      >> > dose', text:'flat dose'},
      >> > {value:'ml',
      >> > text:'ml'},
      >> > {value:'hr',
      >> > text:'hr'},
      >> > {value:'Wk',
      >> > text:'Wk'},
      >> >
      >> > {value:'Cycle', text:'Cycle'}
      >> > ]},
      >> >
      >> >
      >> > {key:"administrationDays",
      >> > label:"Administration Days", editor:this.editSize},
      >> > {key:"cycleLength",
      >> > label:"Cycle Length", editor:this.editSize},
      >> > {key:"cycleNumber",
      >> > label:"Cycle Number", editor:this.editSize},
      >> > {key:"notes", label:"Notes",
      >> > editor:this.editRef}
      >> >
      >> > ];
      >> >
      >> >
      >> >
      >> >
      >> >
      >> >
      >> > var qs = "?request_id=" + Math.random();
      >> >
      >> > qs+= "®Key="+regKey;
      >> >
      >> >
      >> >
      >> > var xhrURL = dlURL+"getRegimenDrug.do"+qs;
      >> > myDrugDS = new YAHOO.util.DataSource(xhrURL);
      >> > myDrugDS.responseType =
      >> > YAHOO.util.DataSource.TYPE_XML;
      >> > myDrugDS.responseSchema = {
      >> >
      >> > resultNode: "DrugMarkUp",
      >> > fields:
      >> >
      > ["drugId", "catGroupId", "drugDosingDesc", "drugDosingUom", "drugDosi
      >> >
      > ngSize", "cycleLength", "cycleNumber", "administrationDays", "notes",
      >> > "dosingPer","regKey"]
      >> >
      >> > };
      >> >
      >> > myDrugTable = new YAHOO.widget.DataTable
      >> > ("drugTable", wrkColHeader, myDrugDS);
      >> >
      >> >
      >> >
      >> > }
      >> >
      >> >
      >> >
      >> >
      >> >
      >> > Then there is this function which gets called as and when I
      > swtich
      >> > rows
      >> >
      >> > showChildren()
      >> > {
      >> > //Get Parent Key and store it as regKey
      >> >
      >> > if (myDrugTable === undefined) {
      >> >
      >> > loadDrugTable(regKey);
      >> > } else {
      >> > alert('inside else');
      >> >
      >> >
      >> >
      >> > dsNew.sendRequest(
      >> > 'regKey='+regKey,
      >> >
      >> > myDrugTable.onDataReturnInitializeTable,
      >> > myDrugTable
      >> > );
      >> >
      >> > }
      >> >
      >> >
      >> > }
      >> >
      >> >
      >> >
      >> >
      >> >
      >> >
      >> >
      >> >
      >> >
      >> >
      >> >
      >> >
      >> >
      >> > --- In ydn-javascript@yahoogroups.com, "Satyam" <satyam@> wrote:
      >> >>
      >> >> DataTable's destroy() method is not trivial, it does quite a lot
      >> > of things
      >> >> and it is most certainly onerous. It has to destroy one by one
      >> > all the
      >> >> listeners that makes the table interactive, all the auxiliary
      >> > items such as
      >> >> cell editors and such that it creates, drag and drop proxies for
      >> > column
      >> >> resizing and dragging and some other things. Moreover, I would
      >> > guess that
      >> >> right after destroying the original ones, you are creating them
      >> > again with
      >> >> new data. This is a lot of work. If your child tables change
      > the
      >> > data but
      >> >> not the structure, why not refreshing them with data. That will
      >> > make your
      >> >> application much faster.
      >> >>
      >> >> In:
      >> >>
      >> >> http://www.satyam.com.ar/yui/#TableWithDetails
      >> >>
      >> >> you can see how a set of child tables can be refreshed with new
      >> > data
      >> >> depending on the row clicked on the parent table.
      >> >>
      >> >> Satyam
      >> >>
      >> >> ----- Original Message -----
      >> >> From: "myworld100us" <myworld100us@>
      >> >> To: <ydn-javascript@yahoogroups.com>
      >> >> Sent: Friday, May 02, 2008 3:08 AM
      >> >> Subject: [ydn-javascript] Datatable destroy
      >> >>
      >> >>
      >> >> > Guys ,
      >> >> >
      >> >> > I noticed this . Off Late in My Web Application I get this
      > error
      >> >> > "A Script on the page causes the IE to run slow" . On further
      >> >> > debugging my code , I noticed that its because of this destroy
      >> > method
      >> >> > on the datatable . This is what I am doing .I destory the
      > child
      >> >> > Datatale as and when the parent Datattable rows are changed .
      >> >> >
      >> >> >
      >> >> > myDataTable.subscribe('rowSelectEvent',function (oArgs)
      >> >> > {
      >> >> >
      >> >> > var target = oArgs.record;
      >> >> > var recIndex = myDataTable.getRecordIndex(target );
      >> >> > var regKey = myDataTable.getRecord(recIndex).getData
      > ("regTree");
      >> >> > if((myDiagTable!=undefined)||(myDiagTable!=null))
      >> >> > {
      >> >> >
      >> >> > myDiagTable.destroy();
      >> >> > myDiagTable = null;
      >> >> >
      >> >> > }
      >> >> >
      >> >> > if((myDrugTable!=undefined)||(myDrugTable!=null))
      >> >> > {
      >> >> >
      >> >> > myDrugTable.destroy();
      >> >> > myDrugTable= null;
      >> >> >
      >> >> >
      >> >> > }
      >> >> >
      >> >> >
      >> >> >
      >> >> > });
      >> >> >
      >> >> >
      >> >> >
      >> >> >
      >> >> >
      >> >> >
      >> >> >
      >> >> >
      >> >> >
      >> >> > ------------------------------------
      >> >> >
      >> >> > Yahoo! Groups Links
      >> >> >
      >> >> >
      >> >> >
      >> >> >
      >> >> >
      >> >> > --
      >> >> > No virus found in this incoming message.
      >> >> > Checked by AVG.
      >> >> > Version: 7.5.524 / Virus Database: 269.23.7/1410 - Release
      > Date:
      >> >> > 01/05/2008 17:30
      >> >> >
      >> >> >
      >> >>
      >> >
      >> >
      >> >
      >> > ------------------------------------
      >> >
      >> > Yahoo! Groups Links
      >> >
      >> >
      >> >
      >> >
      >> >
      >> > --
      >> > No virus found in this incoming message.
      >> > Checked by AVG.
      >> > Version: 7.5.524 / Virus Database: 269.23.7/1410 - Release Date:
      >> > 01/05/2008 17:30
      >> >
      >>
      >
      >
      >
      > ------------------------------------
      >
      > Yahoo! Groups Links
      >
      >
      >
      >
      >
      > --
      > No virus found in this incoming message.
      > Checked by AVG.
      > Version: 7.5.524 / Virus Database: 269.23.8/1412 - Release Date:
      > 02/05/2008 16:34
      >
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.