@randy-k-moregmail-com

@randy-k-moregmail-com

Forum Replies Created

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • in reply to: Customize Tree Drag Drop #112816
    Randy More
    Participant

    I was able to get it to work this way

    
    <blockquote>@page "/"
    @using Smart.Blazor;
    @inject IJSRuntime JS
    
    window.smartTreeInterop = {
    preventDragDefault: function (treeId)
    {
    const tree = document.getElementById(treeId);
    if (tree)
    {
    // tree.addEventListener("dragStart", function (e) {
    // e.dataTransfer.effectAllowed = "copyMove";
    // }, true); // useCapture=true to catch early
    
    tree.addEventListener("dragEnd", function (e) {
    e.preventDefault();
    }, true); // useCapture=true to catch early
    }
    }
    };
    
    

    protected override async Task OnAfterRenderAsync(bool firstRender)
    {
    if (firstRender)
    {
    await JS.InvokeVoidAsync(“smartTreeInterop.preventDragDefault”, “Tree1”);
    await JS.InvokeVoidAsync(“smartTreeInterop.preventDragDefault”, “Tree2”);
    }
    }

    • This reply was modified 2 months, 3 weeks ago by Randy More.
    in reply to: Customize Tree Drag Drop #112815
    Randy More
    Participant

    This does not really help.  I am in Blazor.  This example is JS.
    I have limited experience in interop and chose Smart.Blazor and to do the project in Blazor for that reason.
    can I do a similar in C# in Blazor?
    if not can you give an example that is more targeted for a Blazor project please

    in reply to: Creating a row-major grid #112733
    Randy More
    Participant

    turns out transposed grids are not natively supported in Smart.Blazor as in some other packages.
    may I suggest this would be a nice feature in future.
    In any event can just transpose the data in code and get a similar result, just a bit of bother

Viewing 3 posts - 1 through 3 (of 3 total)