Components
    • Animation
    • Buttons
    • Charts
    • Common Utilities
    • Conversational UI
    • Data Query
    • Data Tools
    • Date Inputs
    • Date Math
    • Dialogs
    • Drawing
    • Dropdowns
    • Editor
    • Excel Export
    • File Saver
    • Form
    • Gantt
    • Gauges
    • Grid
    • Indicators
    • Inputs
    • Labels
    • Layout
    • ListBox
    • ListView
    • Notification
    • PDF Processing
    • Popup
    • Progress Bars
    • Ripple
    • Scheduler
    • Sortable
    • Tooltip
    • TreeList
    • TreeView
    • Upload
    Sample Applications
    Styling & Themes
    Common Features
    Project Setup
    Changelog

setter

Can be used for setting value to object using field path. For example users[index].name.

const values = {users:[{lastName: 'Doe'}]};
const firstUserFirstName = setter('user[0].firstName');

firstUserFirstName(values, 'John');

console.log(values)

// result: {users:[{firstName: 'John', lastName: 'Doe'}]}

Parameters

field

string

Returns

any

In this article

Not finding the help you need?