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

Re: removing and inserting columns from datatable

Expand Messages
  • razer2176
    I love you, really i do :) that fixed it, thanks alot Satyam :)
    Message 1 of 7 , Apr 30, 2009
    • 0 Attachment
      I love you, really i do :)

      that fixed it, thanks alot Satyam :)


      --- In ydn-javascript@yahoogroups.com, Satyam <satyam@...> wrote:
      >
      > Perhaps you need to refresh the DataTable by calling method render()
      >
      > Satyam
      >
      >
      > razer2176 escribió:
      > > Thats what i did before removing the column, i stored it in a variable using the getColumn Method. When i tried to insert this column again at a later point there where no records / values in the cells. The column was inserted back into the table without values in the cells. Maybe that is a bug?
      > >
      > > I tried using the show and hideColumn Methods before but since these two Methods only hide the div element in the cell and not the cell itself it gave an ugly border. I just fixed the css so it will apply display:none to the table cells too, which removes the ugly line, but i am still curious why insertColumn(column) displays no records.
      > >
      > > greetings,
      > >
      > > raz
      > >
      > > --- In ydn-javascript@yahoogroups.com, Satyam <satyam@> wrote:
      > >
      > >> You can use getColumn to get the column information before removing it.
      > >>
      > >> You might also want to look into showColumn and hideColumn, perhaps
      > >> that's all you need.
      > >>
      > >> Satyam
      > >>
      > >>
      > >> razer2176 escribió:
      > >>
      > >>> But how can I get the column that was removed from the datatable previously and insert it back with the same values using the myDataTable.insertColumn() function.
      > >>>
      > >>> So basicly what i am doing is:
      > >>>
      > >>> first remove one column from the datatable ->
      > >>> myTable.removeColumn(myTable.getColumn(0));
      > >>>
      > >>> removes the column at index 0 from the table.
      > >>>
      > >>> Now i want, at a later point or event, put that column back to the table at index 0. How can i retrieve the column that was removed earlier with its values and use myTable.insertColumn() function to insert it back into the datatable?
      > >>>
      > >>> cheers for the help,
      > >>>
      > >>> raz
      > >>>
      > >>> --- In ydn-javascript@yahoogroups.com, Satyam <satyam@> wrote:
      > >>>
      > >>>
      > >>>> The column information is only used to show the data on the DataTable,
      > >>>> the values for the column are not stored there and its removal and later
      > >>>> insertion won't make a difference to the data itself. The data is
      > >>>> stored in Records in the Recordset. At any time there might be more
      > >>>> columns than values in each record or the other way around. In the
      > >>>> first case, you might want to add visible interface elements with no
      > >>>> relation to stored values, in the second you might want to have extra
      > >>>> info for internal use which is not meant to be shown to the user. So,
      > >>>> inserting a column that was previously removed will show the same values
      > >>>> as it had before since they are not altered in any way.
      > >>>>
      > >>>> Satyam
      > >>>>
      > >>>>
      > >>>> razer2176 escribió:
      > >>>>
      > >>>>
      > >>>>> Hi again,
      > >>>>>
      > >>>>> I am digging through dt api right now trying to figure out how to use the myDataTable.insertColumn() Method.
      > >>>>>
      > >>>>> Szenario:
      > >>>>>
      > >>>>> I have a datatable with 12 columns. On instantiation I show all the columns. With myDataTable.removeColumn(myDataTable.getColumn(index)) I am able to remove columns at the given index from the datatable. I checked the dataTable.columnSet().getDefinitions() and noticed that when I remove a column from the datatable, the column is also removed from the columnSet.
      > >>>>>
      > >>>>> Now I am wondering how can I use the myDataTable.insertColumn() Method to reinsert the column, that was removed before. Using myDataTable.insertColumn(oColumn,index) needs a column instance as argument. My guess would be to fetch the column from the columnSet() or somesort but unfortunatly as described above, the removed column from myDataTable is also removed from the columnSet. Inserting a column with no records is not the problem, but I want the column to be populated with data from the recordSet. Do I need to iterate over the recordSet and fetch the data from each entry in that array at the given column index? How does the record to column mapping work internally? I am a bit confused right now and could need some advice on this.
      > >>>>>
      > >>>>> thanks,
      > >>>>>
      > >>>>> raz
      > >>>>>
      > >>>>>
      > >>>>>
      > >>>>> ------------------------------------
      > >>>>>
      > >>>>> Yahoo! Groups Links
      > >>>>>
      > >>>>>
      > >>>>>
      > >>>>> ------------------------------------------------------------------------
      > >>>>>
      > >>>>>
      > >>>>> No virus found in this incoming message.
      > >>>>> Checked by AVG - www.avg.com
      > >>>>> Version: 8.5.287 / Virus Database: 270.12.9/2087 - Release Date: 04/29/09 18:03:00
      > >>>>>
      > >>>>>
      > >>>>>
      > >>>>>
      > >>>
      > >>>
      > >>> ------------------------------------
      > >>>
      > >>> Yahoo! Groups Links
      > >>>
      > >>>
      > >>>
      > >>> ------------------------------------------------------------------------
      > >>>
      > >>>
      > >>> No virus found in this incoming message.
      > >>> Checked by AVG - www.avg.com
      > >>> Version: 8.5.287 / Virus Database: 270.12.9/2087 - Release Date: 04/29/09 18:03:00
      > >>>
      > >>>
      > >>>
      > >
      > >
      > >
      > >
      > > ------------------------------------
      > >
      > > Yahoo! Groups Links
      > >
      > >
      > >
      > > ------------------------------------------------------------------------
      > >
      > >
      > > No virus found in this incoming message.
      > > Checked by AVG - www.avg.com
      > > Version: 8.5.287 / Virus Database: 270.12.9/2087 - Release Date: 04/29/09 18:03:00
      > >
      > >
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.