How to copy the header fields of the grid

  1. #1

    How to copy the header fields of the grid

    We are implementing grid panel based on following example.

    https://examples4.ext.net/#/Kitchen_...ked_GridPanel/.

    We are asked by the customer if it would be possible to copy the header fields(Name, Rating, Cuisine, Review), not the value of the each columns(Tamarine, Three seasons etc).

    Are there any way to copy them?

    We are using ext.net 4.2.2.
  2. #2
    Hello,

    You can get the names of the columns from the column model of the GridPanel. Something like the following in JavaScript should work:

    1. Get an instance of the GridPanel component
    2. Get the Columns using .getColumns()
    3. Loop through all the Columns using forEach or a for loop
    4. Get the .text value of each Column

    App.GridPanel1.getColumns().forEach(function(column) { console.log(column.text) });
    Hope this helps.
  3. #3
    Hi Geoffrey,

    Thank you for the quick answer.

    The image for copying we had is drag the column name and copy by Ctrl+C similar for the text selection to the value.

    <View>
       <ext:GridView runat="server" EnableTextSelection="true" />
    </View>
    Is your suggestion more like to create the program to copy to the clipboard when on-click or hover the mouse over the column name?



    Regards,
    Masato
    Last edited by mkomiyama; Aug 05, 2020 at 5:46 AM.
  4. #4
    How about adding a button that when clicked copies the value(s) into the users clipboard?
    Geoffrey McGill
    Founder

Similar Threads

  1. Copy/Paste from Excel to Grid
    By Rosta in forum 2.x Help
    Replies: 0
    Last Post: Jun 03, 2016, 7:39 AM
  2. [CLOSED] How to- copy/paste grid cell within same grid
    By susanz in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Mar 06, 2015, 7:14 PM
  3. [CLOSED] Excel copy/paste Grid
    By FpNetWorth in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Feb 11, 2014, 12:28 PM
  4. Replies: 0
    Last Post: Oct 15, 2012, 12:38 PM
  5. [CLOSED] Copy text from "readonly" date and combo box fields
    By betamax in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Sep 24, 2012, 2:56 PM

Posting Permissions