[CLOSED] from listener cellclick to directmethod with e.raw parameter

  1. #1

    [CLOSED] from listener cellclick to directmethod with e.raw parameter

    Hi,

    In version 2.5 I used a listener on a gridrow which under certain conditions calls a directmethod passing e.raw.
    This e.raw is not accepted anymore in the directmethod in version 3 (latest release).

    Error:
    System.ArgumentException: DirectMethod: 'gpOrganisation_onClick', The parameter 'cJson' is undefined bij Ext.Net.DirectMethod.Invoke(Object target, HttpContext context, ParameterCollection args)



        var cellClickOrganisation = function (grid, rowIndex, columnIndex, e) {
                    var baseid = e.get("organisation_id");    // Get the Record      
                    var description = e.get("organisationname");
                    if (columnIndex == 0) {
                        //the delete button is pressed         
                        var before = #{hiddenTextDeleteQuestionBefore}.value;    
                        var after = #{hiddenTextDeleteQuestionAfter}.value;       
                        if (confirm(before + ' ' + description + ' '+after)) {
                            #{DirectMethods}.DeleteOrganisation(baseid);
                        } else {
                            return false;
                        }
                    } else {
                        #{DirectMethods}.gpOrganisation_onClick(e.raw);
                    }
                };
        <DirectMethod()> _
        Public Sub gpOrganisation_onClick(ByVal cJson As String)
             Dim jsonevent As jsonEventArgs = New jsonEventArgs
            Dim xml As XmlNode = JSON.DeserializeXmlNode("{records:{record:" + cJson + "}}")
            Dim cId As String = ""
    
            For Each row As XmlNode In xml.SelectNodes("records/record")
                cId = row.SelectSingleNode("organisation_id").InnerXml
                ' etc etc
            Next
        End Sub
    Any idea how to pass the row data?

    Hans
    Last edited by Daniil; Aug 24, 2015 at 4:50 PM. Reason: [CLOSED]
  2. #2
    Hi @HansWapenaar,

    Confirm, there was a change. There is no record's raw property anymore. All the raw data is kept on the reader level:
    store.proxy.reader.rawData
    You can grab a record's raw data from there or try to use a record's data instead if appropriate - record.data. Is there any specific reason to use record.raw rather than record.data?
  3. #3
    Hi Daniil,

    Changing parameter e.raw to e.data makes it work again.
    I cannot remember why I used raw. Made it quite some time ago. Probably took it from an example.


    Thanks,hans

Similar Threads

  1. DirectMethod - how to pass an array parameter
    By tcunha in forum 2.x Help
    Replies: 3
    Last Post: May 21, 2014, 10:17 AM
  2. [CLOSED] DirectMethod Parameter Value from JavaScript
    By VirtualArtists in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Apr 08, 2013, 9:48 PM
  3. [CLOSED] [#49] Directmethod exception with hashtable as parameter
    By Patman in forum 1.x Legacy Premium Help
    Replies: 22
    Last Post: Mar 05, 2013, 5:11 PM
  4. Replies: 0
    Last Post: May 14, 2012, 3:41 PM
  5. [CLOSED] DirectMethod --> Webservice with Dictionary parameter
    By jchau in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jan 20, 2011, 9:15 PM

Posting Permissions