greg_808

How would i reload a gridfield with js. If one Gridfield changes i wan’t to reload another. This is what i have so far. I get the change event but i am not able to relod the gridfield. Is it even possible with entwine at the moment or do i need to use react?

  1. (function ($) {
  2. $.entwine(function ($) {
  3. if ($('#Form_ItemEditForm_Summary')) {
  4. $('#Form_ItemEditForm_B2BOrderItems').entwine({
  5. onchange: function () {
  6. $('#Form_ItemEditForm_Summary').reload();
  7. }
  8. })
  9. }
  10. });
  11. })(jQuery);
greg_808

Is there a better way to get an Json string from an DataObject than

  1. json_encode(DataObject->getQueriedDatabaseFields())

???

👍 (1)
null

This might help you: https://github.com/phptek/silverstripe-jsontext

Show 1 attachment(s)
GitHub  
phptek/silverstripe-jsontext

JSON storage and querying. Contribute to phptek/silverstripe-jsontext development by creating an account on GitHub.

Hide attachment content
greg_808

Nice little trick, it worked. Here is a code snipet

  1. ---
  2. Name: TicketShopConfig
  3. ---
  4. SilverShop\Discounts\Admin\DiscountModelAdmin:
  5. managed_models: false
  6. ---
  7. Name: TicketShopConfig2
  8. After:
  9. - #TicketShopConfig
  10. ---
  11. SilverShop\Discounts\Admin\DiscountModelAdmin:
  12. managed_models:
  13. - 'SilverShop\Discounts\Model\OrderCoupon'