Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #104538
    wolf.t
    Participant

    My goal is to get all currently visible rows in the grid.
    In order to do that I’ve been trying to use GetVisibleRows() but I’ve been getting the following Exception:

    
    Microsoft.JSInterop.JSException: Converting circular structure to JSON
    blazor.webassembly.js:1 --> starting at object with constructor 'BaseElement'
    blazor.webassembly.js:1 | property '$' -> object with constructor 'f'
    blazor.webassembly.js:1 | property 'events' -> object with constructor 'Object'
    blazor.webassembly.js:1 | ...
    blazor.webassembly.js:1 | index 0 -> object with constructor 'Object'
    blazor.webassembly.js:1 --- property 'context' closes the circle
    blazor.webassembly.js:1 TypeError: Converting circular structure to JSON
    blazor.webassembly.js:1 --> starting at object with constructor 'BaseElement'
    blazor.webassembly.js:1 | property '$' -> object with constructor 'f'
    blazor.webassembly.js:1 | property 'events' -> object with constructor 'Object'
    blazor.webassembly.js:1 | ...
    blazor.webassembly.js:1 | index 0 -> object with constructor 'Object'
    blazor.webassembly.js:1 --- property 'context' closes the circle
    blazor.webassembly.js:1 at JSON.stringify (<anonymous>)
    blazor.webassembly.js:1 at O (https://localhost:7010/_framework/blazor.webassembly.js:1:5193)
    blazor.webassembly.js:1 at Object.invokeJSFromDotNet (https://localhost:7010/_framework/blazor.webassembly.js:1:3254)
    blazor.webassembly.js:1 at Object.St [as invokeJSFromDotNet] (https://localhost:7010/_framework/blazor.webassembly.js:1:59918)
    blazor.webassembly.js:1 at _mono_wasm_invoke_js_blazor (https://localhost:7010/_framework/dotnet.6.0.11.5kzn1v3580.js:1:195300)
    blazor.webassembly.js:1 at wasm://wasm/00971d3e:wasm-function[219]:0x1a492
    blazor.webassembly.js:1 at wasm://wasm/00971d3e:wasm-function[167]:0xce60
    blazor.webassembly.js:1 at wasm://wasm/00971d3e:wasm-function[166]:0xbd73
    blazor.webassembly.js:1 at wasm://wasm/00971d3e:wasm-function[2815]:0xabec4
    blazor.webassembly.js:1 at wasm://wasm/00971d3e:wasm-function[1619]:0x6fc85
    blazor.webassembly.js:1 at Microsoft.JSInterop.WebAssembly.WebAssemblyJSRuntime.InvokeJS(String identifier, String argsJson, JSCallResultType resultType, Int64 targetInstanceId)
    blazor.webassembly.js:1 at Microsoft.JSInterop.JSInProcessRuntime.Invoke[IEnumerable'1](String identifier, Int64 targetInstanceId, Object[] args)
    blazor.webassembly.js:1 at Microsoft.JSInterop.JSInProcessRuntime.Invoke[IEnumerable'1](String identifier, Object[] args)
    blazor.webassembly.js:1 at Smart.Blazor.JSRunner.<InvokeGetMethod>d__21'1[[System.Collections.Generic.IEnumerable'1[[System.Object, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].MoveNext()
    blazor.webassembly.js:1 at Smart.Blazor.Grid.GetVisibleRows()
    

    My grid looks like this:

    
    
    <Grid @ref="grid" DataSource="@data">
    <Columns>
    <Column DataField="Id" Width="auto" Visible="false" AllowEdit="false"/>
    <Column DataField="Name" Label="Name" AllowEdit="true"/>
    <Column DataField="BoolValue " Label="BoolValue" AllowEdit="true" DataType="boolean" Editor="@checkBoxEditor" Template="@checkBoxEditor"/>
    </Columns>
    </Grid>
    

    My class look something like this, with @data being List<ClassName>

    
    
    public class Entity
    {
    public Guid Id { get; set; }
    }
    
    public class ClassName: Entity
    {
    public string Name { get; set; }
    public bool BoolValue { get; set; }
    }
    

    What am I doing wrong?

    • This topic was modified 1 year, 1 month ago by wolf.t.
    • This topic was modified 1 year, 1 month ago by wolf.t.
    #104559
    Markov
    Keymaster

    Hi wolf.t,

    Could you share a link to an example in github which we can download and try locally? From the call stack it seems that this is related to the result returned by the method, but we will need to look into that by debugging it.

    Looking forward to your reply.

    Best regards,

    Markov

     

    #104563
    oliver.aldrian
    Participant

    Hello,

     

    colleague of wolf.t here.

     

    Please see https://github.com/DiawaKG/reproduction-smarthtml-grid-getvisiblerows-exception.

    Running the Server project and clicking the Button “Click Me” on the index page reproduces the problem.

     

    KR

    #104585
    Markov
    Keymaster

    Hi,

    The reported Blazor related issue is resolved in the latest Smart.Blazor nuget package. Thank you for reporting it!

    Best regards,

    Markov

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.