对象已移动

可在此处找到该文档 How to Add Dynamic Rows in Magento 2 Configuration. – New Self New Life
New Self New Life
No Result
View All Result
  • Home
  • Entertainment
  • Celebrity
  • Cinema
  • Music
  • Digital Lifestyle
  • Social Media
  • Softwares
  • Devices
  • Home
  • Entertainment
  • Celebrity
  • Cinema
  • Music
  • Digital Lifestyle
  • Social Media
  • Softwares
  • Devices
New Self New Life
No Result
View All Result
Home Softwares

How to Add Dynamic Rows in Magento 2 Configuration.

by admin
3 years ago
in Softwares
How to Add Dynamic Rows in Magento 2 Configuration.
Share on FacebookShare on Twitter


<?php

 

namespace WebkulDynamicrowBlockAdminhtmlKindDiscipline;

 

use MagentoConfigBlockSystemConfigKindDisciplineFieldArrayAbstractFieldArray;

use MagentoFrameworkDataObject;

use MagentoFrameworkExceptionLocalizedException;

use WebkulDynamicrowBlockAdminhtmlKindDisciplineDynamicColumn;

 

class Row extends AbstractFieldArray

{

    /**

     * @var Templete

     */

    personal $templeteRenderer;

 

    /**

     * Put together rendering the brand new subject by including all of the wanted columns

     */

    protected operate _prepareToRender()

    {

        $this->addColumn(‘text_1’, [‘label’ => __(‘Text 1’), ‘class’ => ‘required-entry’]);

        $this->addColumn(‘text_2’, [‘label’ => __(‘Text 2’), ‘class’ => ‘required-entry’]);

        $this->addColumn(‘templete’, [

            ‘label’ => __(‘Select’),

            ‘renderer’ => $this->getTempleteRenderer()

        ]);

        $this->_addAfter = false;

        $this->_addButtonLabel = __(‘Add Row’);

    }

 

    /**

     * Put together current row knowledge object

     *

     * @param DataObject $row

     * @throws LocalizedException

     */

    protected operate _prepareArrayRow(DataObject $row): void

    {

        $choices = [];

 

        $templete = $row->getTemplete();

        if ($templete !== null) {

            $choices[‘option_’ . $this->getTempleteRenderer()->calcOptionHash($templete)] = ‘chosen=”chosen”‘;

        }

 

        $row->setData(‘option_extra_attrs’, $choices);

    }

 

    /**

     *

     * @return Templete

     * @throws LocalizedException

     */

    personal operate getTempleteRenderer()

    {

        if (!$this->templeteRenderer) {

            $this->templeteRenderer = $this->getLayout()->createBlock(

                DynamicColumn::class,

                ”,

                [‘data’ => [‘is_render_to_js_template’ => true]]

            );

        }

        return $this->templeteRenderer;

    }

}

 



Source link

Tags: AddConfigurationDynamicMagentoRows
Previous Post

Ralph Fiennes’ Hit Play ‘Four Quartets’ Is Getting A Film Version – Deadline

Next Post

Dio Node affordable multiroom speaker

Related Posts

This week in AI updates: Mistral’s new Le Chat features, ChatGPT updates, and more (September 5, 2025)
Softwares

This week in AI updates: Mistral’s new Le Chat features, ChatGPT updates, and more (September 5, 2025)

by admin
September 5, 2025
Don’t Have the Backslash or Pipe Symbol? Type \ and | on Any Keyboard [Article]
Softwares

Don’t Have the Backslash or Pipe Symbol? Type \ and | on Any Keyboard [Article]

by admin
September 6, 2025
AI coding assistants speed delivery but multiply security risk
Softwares

AI coding assistants speed delivery but multiply security risk

by admin
September 4, 2025
NFT Real Estate Marketplace Development: Guide to NFT Marketplaces
Softwares

NFT Real Estate Marketplace Development: Guide to NFT Marketplaces

by admin
September 2, 2025
Crash fixes – Vivaldi Browser snapshot 3794.4
Softwares

Crash fixes – Vivaldi Browser snapshot 3794.4

by admin
September 1, 2025
Next Post
Dio Node affordable multiroom speaker

Dio Node affordable multiroom speaker

Smart Watches can help you train like a Pro – Noise

Smart Watches can help you train like a Pro – Noise

  • Trending
  • Comments
  • Latest
I Only Have More Questions After Another Bizarre Outing With The Harrigans

I Only Have More Questions After Another Bizarre Outing With The Harrigans

April 20, 2025
Amazon Forgot to Take the 2024 MacBook Air Off Sale After Their Big Spring Event

Amazon Forgot to Take the 2024 MacBook Air Off Sale After Their Big Spring Event

April 4, 2025
Ecca Vandal’s “CRUISING TO SELF SOOTHE” video is an ode to skate culture

Ecca Vandal’s “CRUISING TO SELF SOOTHE” video is an ode to skate culture

March 10, 2025
Easy Blueberry Scones (With Frozen Blueberries)

Easy Blueberry Scones (With Frozen Blueberries)

April 10, 2025
Tuesday Snapshot – Vivaldi Browser snapshot 3621.3

Tuesday Snapshot – Vivaldi Browser snapshot 3621.3

March 5, 2025
A Global Recognition of Indi

A Global Recognition of Indi

April 21, 2025
It’s time for open-source contributions

It’s time for open-source contributions

February 9, 2025
I finally watched The Truman Show

I finally watched The Truman Show

April 6, 2025
10 Best Vampire TV Couples, Ranked

10 Best Vampire TV Couples, Ranked

September 7, 2025
Taylor Swift Left Travis Kelce’s Trainer’s Daughter In Complete ‘Awe’ With This Sweet Gesture! 

Taylor Swift Left Travis Kelce’s Trainer’s Daughter In Complete ‘Awe’ With This Sweet Gesture! 

September 7, 2025
Google’s AI Ambitions An ‘Existential Crisis’ For News Online

Google’s AI Ambitions An ‘Existential Crisis’ For News Online

September 6, 2025
Netflix Schedule September 8 – September 14, 2025: New TV Shows & Movies Being Added

Netflix Schedule September 8 – September 14, 2025: New TV Shows & Movies Being Added

September 6, 2025
Pamela Anderson: Actress slams rumours of fake relationship with Liam Neeson

Pamela Anderson: Actress slams rumours of fake relationship with Liam Neeson

September 6, 2025
Darth Vader lightsaber goes for more than $3.6M at auction – National

Darth Vader lightsaber goes for more than $3.6M at auction – National

September 6, 2025
ARC Returns to the Birthplace of House Music for Scintillating 2025 Festival

ARC Returns to the Birthplace of House Music for Scintillating 2025 Festival

September 6, 2025
OnePlus and Hasselblad are ending their five-year partnership

OnePlus and Hasselblad are ending their five-year partnership

September 5, 2025
New Self New Life

Your source for entertainment news, celebrities, celebrity news, and Music, Cinema, Digital Lifestyle and Social Media and More !

Categories

  • Celebrity
  • Cinema
  • Devices
  • Digital Lifestyle
  • Entertainment
  • Music
  • Social Media
  • Softwares
  • Uncategorized

Recent Posts

  • 10 Best Vampire TV Couples, Ranked
  • Taylor Swift Left Travis Kelce’s Trainer’s Daughter In Complete ‘Awe’ With This Sweet Gesture! 
  • Google’s AI Ambitions An ‘Existential Crisis’ For News Online
  • Home
  • Disclaimer
  • DMCA
  • Privacy Policy
  • Cookie Privacy Policy
  • Terms and Conditions
  • Contact us

Copyright © 2021 New Self New Life.
New Self New Life is not responsible for the content of external sites. slotsfree  creator solana token

No Result
View All Result
  • Home
  • Entertainment
  • Celebrity
  • Cinema
  • Music
  • Digital Lifestyle
  • Social Media
  • Softwares
  • Devices

Copyright © 2021 New Self New Life.
New Self New Life is not responsible for the content of external sites.

New Self New Life