对象已移动

可在此处找到该文档 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

Speed Dials with Widgets – Vivaldi Browser snapshot 3820.3
Softwares

Speed Dials with Widgets – Vivaldi Browser snapshot 3820.3

by admin
September 28, 2025
Magento 2 SEO for ChatGPT : The AI Ranking Guide
Softwares

Magento 2 SEO for ChatGPT : The AI Ranking Guide

by admin
September 25, 2025
Microsoft fixes Windows automatic apps rearrangement issue
Softwares

Microsoft offers no-cost Windows 10 lifeline

by admin
September 26, 2025
Syncfusion restructures Essential Studio into multiple different suites to provide greater flexibility for developers
Softwares

Syncfusion restructures Essential Studio into multiple different suites to provide greater flexibility for developers

by admin
September 23, 2025
XZ attack reveals unlearned open-source security lessons
Softwares

XZ attack reveals unlearned open-source security lessons

by admin
September 22, 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
Google’s AI Ambitions An ‘Existential Crisis’ For News Online

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

September 6, 2025
A Global Recognition of Indi

A Global Recognition of Indi

April 21, 2025
Tuesday Snapshot – Vivaldi Browser snapshot 3621.3

Tuesday Snapshot – Vivaldi Browser snapshot 3621.3

March 5, 2025
I finally watched The Truman Show

I finally watched The Truman Show

April 6, 2025
Pros and Cons of Having a Family Lawyer

Pros and Cons of Having a Family Lawyer

September 28, 2025
Stars and Their Kids In 2025 — All the Must-See Photos!

Stars and Their Kids In 2025 — All the Must-See Photos!

September 28, 2025
23 Celebs Accused Of Perpetrating Huge Lies And Hoaxes

23 Celebs Accused Of Perpetrating Huge Lies And Hoaxes

September 28, 2025
WhatsApp Rolls Out In-App Message Translation For Android and iOS

WhatsApp Rolls Out In-App Message Translation For Android and iOS

September 28, 2025
Genndy Tartakovsky Releases Test Footage for ‘Black Knight’ Film

Genndy Tartakovsky Releases Test Footage for ‘Black Knight’ Film

September 27, 2025
The Most Underrated Song by 11 Legendary Hair Metal Bands

The Most Underrated Song by 11 Legendary Hair Metal Bands

September 27, 2025
Talent Agents Circle AI Actress Tilly Norwood

Talent Agents Circle AI Actress Tilly Norwood

September 27, 2025
Jason Kelce’s HILARIOUS Response To NBA Stars Wanting To Meet Taylor Swift!

Jason Kelce’s HILARIOUS Response To NBA Stars Wanting To Meet Taylor Swift!

September 27, 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

  • Pros and Cons of Having a Family Lawyer
  • Stars and Their Kids In 2025 — All the Must-See Photos!
  • 23 Celebs Accused Of Perpetrating Huge Lies And Hoaxes
  • 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