[CLOSED] Grid Panel GroupSummary

  1. #1

    [CLOSED] Grid Panel GroupSummary



    Hi,

    See the pages.

    when i add a newrow, then the row is created at top see pic 2.
    when i click the image in column i need to add new row..
    i used javascript for new row creating.

    When i click the edit button i need to focus first group with first column focus.
    if i press tab then i next column.

    how to achive this. i have attached my aspx page also.

    with regards
    speedstep


  2. #2

    RE: [CLOSED] Grid Panel GroupSummary

    Hi,

    I don't understand the problem


    1. How is topic name "GRID PANEL GROUPSUMMARY" related with topic description? I don't see any mentioning about group summary


    2. Please provide more details about the issue. I didn't understand what what you have and what you need. To add a row use 'indertRecord' or 'addRecord' functions. To focus row use 'myGrid.view.focusRow(index)'. I am not sure what you need when tab key pressing


    3. Please simplify example. It is too long and I can't to run it
  3. #3

    RE: [CLOSED] Grid Panel GroupSummary

    Hi,
    i am using Group summery concept in my Gridpanel.This is working fine.but i want to insert a record or row to next row of selectedRow.

    '1.png' image is my page loading time output.

    but after click on the add image, i get '2.png' is my output.

    i ll attach my full source .pls take and look it.

    my insert row javascript.
    
    
    function NextRow(grid, command, record, row) {
    
    
    var id = command.data.ProjectID;
    
    
    var name = command.data.Name;
    
    
    var taskid = command.data.TaskID;
    
    
    var desc = command.data.Description;
    
    
    var est = command.data.Estimate;
    
    
    var rate = command.data.Rate;
    
    
    record++;
    
    
    GridPanel1.insertRecord(record, { ProjectID: id, Name: name, TaskID: taskid, Description: desc, Estimate: est, Rate: rate });
    
    
    GridPanel1.View.focusRow(record);
    
    
    }
    
    
    <Listeners>
    
    
    <Command Fn="NextRow" />
    
    
    </Listeners>
  4. #4

    RE: [CLOSED] Grid Panel GroupSummary

    Hi,

    Please see the attachment.
    sample code provided.

    1. when i click image in grid i need to add new row within that group itself..
    how to do this.



  5. #5

    RE: [CLOSED] Grid Panel GroupSummary

    Hi,

    Please see the following sample
    <%@ Page Language="C#" %>
    <%@ Import Namespace="System.Collections.Generic"%>
    
    <%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
        <title></title>
    
        <script type="text/javascript">
            function NextRow(command, record, row, col) {
                this.insertRecord(row+1, { CONTACT: record.data.CONTACT, AREA: record.data.AREA, STREET: record.data.STREET, CITY: record.data.CITY, IMAGE: record.data.IMAGE });                       
                this.view.refresh();
            }            
        </script>
        
        <script runat="server">
                protected void Page_Load(object sender, EventArgs e)
                {
                    if (!IsPostBack)
                    {
                        this.Store1.DataSource = new List<Project> 
                        {
                            new Project("ABC", "AB", "A", "Cbe1", "0"),
                            new Project("ABC", "AB", "A", "Cbe2", "1"),
                            new Project("DEF", "DE", "D", "Cbe3", "2"),
                            new Project("DEF", "DE", "D", "Cbe4", "3"),
                            new Project("GHI", "GH", "G", "Cbe5", "4"),
                            new Project("GHI", "GH", "G", "Cbe6", "5"),
                            new Project("JKL", "JK", "J", "Cbe7", "6"),
                            new Project("JKL", "JK", "J", "Cbe8", "7"),
                            new Project("MNO", "MN", "M", "Cbe9", "8"),
                            new Project("MNO", "MN", "M", "Cbe10", "9")
                        };
                        this.Store1.DataBind();
                    }
                } 
                public class Project
                {
                    public Project(string contact, string area, string street, string city, string image)
                    {
                        this.CONTACT = contact;
                        this.AREA = area;
                        this.STREET = street;
                        this.CITY = city;
                        this.IMAGE = image;           
                    }
    
                    public string CONTACT { get; set; }
                    public string AREA { get; set; }
                    public string STREET { get; set; }
                    public string CITY { get; set; }
                    public string IMAGE { get; set; }        
                }
        </script>
    
    </head>
    <body>
        <form id="form1" runat="server">
        
            <ext:ScriptManager ID="ScriptManager1" runat="server" >
            </ext:ScriptManager>
            <ext:Store ID="Store1" runat="server" GroupField="CONTACT">
                <Reader>
                    <ext:JsonReader ReaderID="ID">
                        <Fields>
                            <ext:RecordField Name="CONTACT">
                            </ext:RecordField>
                            <ext:RecordField Name="AREA">
                            </ext:RecordField>
                            <ext:RecordField Name="STREET">
                            </ext:RecordField>
                            <ext:RecordField Name="CITY">
                            </ext:RecordField>
                            <ext:RecordField Name="IMAGE">
                            </ext:RecordField>
                        </Fields>
                    </ext:JsonReader>
                </Reader>
            </ext:Store>
            <ext:ViewPort ID="ViewPort1" runat="server">
                <Body>
                    <ext:BorderLayout ID="BorderLayout1" runat="server">
                        <Center>
                            <ext:Panel ID="Panel7" runat="server">
                                <Body>
                                    <ext:FitLayout ID="FitLayout2" runat="server">
                                        <ext:GridPanel ID="GridPanel1" runat="server" StoreID="Store1">
                                            <ColumnModel>
                                                <Columns>
                                                    <ext:GroupingSummaryColumn DataIndex="CONTACT" Header="Contact">
                                                    </ext:GroupingSummaryColumn>
                                                    <ext:Column DataIndex="AREA" Header="Area">
                                                    </ext:Column>
                                                    <ext:Column DataIndex="STREET" Header="Street">
                                                    </ext:Column>
                                                    <ext:Column DataIndex="CITY" Header="City">
                                                    </ext:Column>
                                                    <ext:ImageCommandColumn Width="110">
                                                        <Commands>
                                                            <ext:ImageCommand CommandName="Add" Icon="Add">                                                            
                                                            </ext:ImageCommand>                                                        
                                                        </Commands>                                              
                                                    </ext:ImageCommandColumn>
                                                </Columns>
                                            </ColumnModel>
                                            <Listeners>
                                                <Command Fn="NextRow" />
                                            </Listeners>
                                            <SelectionModel>
                                                <ext:RowSelectionModel ID="RowSelectionModel1" runat="server">
                                                </ext:RowSelectionModel>
                                            </SelectionModel>
                                            <View>
                                                <ext:GroupingView ID="GroupingView1" runat="server" ForceFit="true"
                                                    StartCollapsed="false" EnableRowBody="true" HideGroupedColumn="false">
                                                </ext:GroupingView>
                                            </View>
                                            <Buttons>
                                                <ext:Button ID="Btn_Add" runat="server" Text="Add" AutoPostBack="false" Icon="NoteAdd">
                                                </ext:Button>
                                                <ext:Button ID="Btn_Edit" runat="server" Text="Edit" AutoPostBack="false" Icon="NoteEdit">
                                                </ext:Button>
                                            </Buttons>
                                        </ext:GridPanel>
                                    </ext:FitLayout>
                                </Body>
                            </ext:Panel>
                        </Center>
                    </ext:BorderLayout>
                </Body>
            </ext:ViewPort>
        
    
        </form>
    </body>
    </html>
  6. #6

    RE: [CLOSED] Grid Panel GroupSummary



    Hi,

    on clicking the image in grid, new row created within that group itself. but

    1. the loading mask is missing. I need loading mask when click image in grid.
    2. when i click image in grid new row created and the focus is not in newrow. i need focus is in new row.

    how to get this.





  7. #7

    RE: [CLOSED] Grid Panel GroupSummary

    Hi,


    1. "the loading mask is missing" - Why do you expect loading mask? You can show loading mask
    GridPanel1.body.mask();
    GridPanel1.body.unmask();
    But why it is required in that case?

    2. Focus row... Do you need focus row only or selection also?
    function NextRow(command, record, row, col) {
                var newRecord = this.insertRecord(row+1, { CONTACT: record.data.CONTACT, AREA: record.data.AREA, STREET: record.data.STREET, CITY: record.data.CITY, IMAGE: record.data.IMAGE });                       
                this.view.refresh();
                
                var index = this.store.indexOf(newRecord);
                this.view.focusRow(index);
                this.getSelectionModel().selectRow(index);
            }
  8. #8

    RE: [CLOSED] Grid Panel GroupSummary



    Hi,

    work fine ...

Similar Threads

  1. Replies: 5
    Last Post: Dec 26, 2011, 5:39 AM
  2. Replies: 0
    Last Post: Sep 27, 2011, 7:54 AM
  3. Replies: 16
    Last Post: Feb 23, 2011, 10:03 AM
  4. Replies: 0
    Last Post: Jan 06, 2011, 9:50 PM
  5. Replies: 0
    Last Post: Apr 06, 2010, 10:01 AM

Posting Permissions