GridPanel Renderer doesn' work

  1. #1

    GridPanel Renderer doesn' work

    <script type="text/javascript">
        var renderFileLink = function (value, meta, record) {
            var a = Ext.net.DirectMethods.<%=ClientID%>.GetFilePath(record.data.Source, record.data.FileName, record.data.TypeId);
            alert(a);
            return a;
        }
        
    </script>
    
    <!--some code  ------>
    <ColumnModel runat="server">
            <Columns>
                <ext:Column Header="Описание файла" DataIndex="Description" Width="250">
                    <Renderer Fn="renderFileLink" />
                </ext:Column>
            </Columns>
        </ColumnModel>
    
    [DirectMethod]
    public string GetFilePath(Guid sourceId, string fileName, int fileType) {
           var a = sourceId.ToString() + fileName + fileType.ToString();
           return a;
    }
    The function renderFileLink always returns "undefined", but the method "GetFilePath" returns the other (properly) data. But I want to display the data which has been received from the method "GetFilePath". How can I do it?
  2. #2
    DirectMethods are async action (because it uses XmlHttpRequest which is async by default)
    It means that you have to use callbacks (success/failure) to retrieve the result
    You cannot use direct methods in the renderer because renderer requires immediate answer

    If you need to show some server side data then bind it as RecordField in the store
  3. #3
    It's good, very good!

Similar Threads

  1. [CLOSED] Renderer does not work on DateColumn in GridPanel
    By Jurke in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Feb 04, 2011, 11:04 AM
  2. Replies: 0
    Last Post: May 11, 2010, 10:35 PM
  3. [CLOSED] GridPanel Row Tooltip ShowDelay doesn't work.
    By drkoh in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: May 06, 2010, 4:05 PM
  4. [CLOSED] [1.0] GridPanel nested in a Panel doesn't work
    By PoloTheMonk in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Dec 18, 2009, 8:16 PM
  5. GridPanel AutoScroll doesn't work when empty
    By dbassett74 in forum 1.x Help
    Replies: 2
    Last Post: May 24, 2009, 11:03 PM

Posting Permissions