Question

Photo of Adeel Khalid

0

Added new block and Grid events not working with grid action buttons

Hi there,

I've added a new block for showing specific users based on their id's as an input, I've implement a grid to show the members against the input id's, all grid buttons like communication, add new etc are shown but they don't work as they work on other screens, what things should I do to make them work?


  • Photo of Michael Garrison

    0

    Adeel, which block is it you've added, or are you saying you've programmed a new custom block type in visual studio?

    If it's a dynamic data block for instance,, the grid actions require a column named Id with nothing but the person id number in it. It's ok to hide that column though.

  • Photo of Adeel Khalid

    0

    Yes, I've programmed a new one in groups. It will be easier for you if you go through the code i've attached in a file, its simple one.

    https://drive.google.com/file/d/1RS8slGQ5gx_zmaB-hTAJzLmL1LqZs-W2/view?usp=sharing

    • Michael Garrison

      Right on. Not something I'll be able to help with unfortunately, but I'll put a bug in a few ears to see if we can get you some assistance

  • Photo of Adeel Khalid

    0

    Ok thanks.

  • Photo of Daniel Hazelbaker

    0

    Adeel, There are a number of problems I see, but I can only speculate since you didn't give very many details about exactly what isn't working. The only thing you specifically mentioned was the communication and add buttons.

    The first thing I see is that you are not handling the GridRebind event. It's there for a reason and must exist for the Grid control to work correctly. You will need to re-implement that.

    The second thing is you are not binding the Add button to anything. Because the Add button will do different things for different blocks, you have to implement it yourself. The grid doesn't know "what" you want to add or how to do it so you need to handle that button event in your own code.

  • Photo of Adeel Khalid

    0

    Thanks for your reply Daniel, I understand how events are generated and all the stuff but I'm new to the Rock, its structure is confusing me. I've implemented the communication and other actions but I didn't know what to pass on communication page, merge page when these events are fired.

    For example my grid is showing what I want it to show and based on the record selection from the Grid when I click on communicate, It should redirect me to the communicate page like it does on other pages, this causes me confused how to redirect to that page and after finishing work on communication page it redirects back to the main page. I know how it works in asp.net or mvc but with Rock i'm stuck.

  • Photo of Amit K

    0

    Hi Adeel/Denial,

    May you help with same, How may i handle Action event like Bulk update?