Modifying column array properties using jsstore

I am working with a jsstore table called tblInvoice

    const tblInvoice: ITable = {
      name: "invoice",
      columns: {
        // Here "Id" is name of column
        id: { autoIncrement: true, primaryKey: true, notNull: false },
        branchId: { notNull: true, dataType: DATA_TYPE.Number },
        invoiceNumber: { notNull: false, dataType: DATA_TYPE.String },
        totalDiscount: { notNull: true, dataType: DATA_TYPE.Number },
        amountPaid: { notNull: true, dataType: DATA_TYPE.Number },
        remainingAmount: { notNull: true, dataType: DATA_TYPE.Number },
        createAt: { notNull: true, dataType: DATA_TYPE.DateTime },
        client: { notNull: false, dataType: DATA_TYPE.Object },
        total: { notNull: true, dataType: DATA_TYPE.Number },
        netTotal: { notNull: true, dataType: DATA_TYPE.Number },
        productsCount: { notNull: true, dataType: DATA_TYPE.Number },
        items: { notNull: true, dataType: DATA_TYPE.Array, multiEntry: true },
      },
      version: this.currentVersion,
    };

My current task is to modify the property value in the column items, specifically the quantity

Answer №1

If you want to make a second version, simply follow these steps:

var table1 = {
    name: "table_name",
     columns: {
        column1: { dataType: 'datatype', primaryKey: true },
        column2 : { dataType: 'datatype'},
        ..... ,
        columnN: { dataType: 'datatype' }
    },
    version: 2 //By default, version is set to 1.
}

Remember not to declare your jsstore with const

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Notify other components in Angular when a change has occurred without relying on intervals

In the footer component of my project, I currently have a code snippet that runs a check on LocalStorage every 15 seconds using a timer. ngOnInit() { const checkLocalStorage = interval(15000); checkLocalStorage.subscribe(data => { ...

tips for extracting data from a javascript chart without an internet connection

Recently, I've been exploring a website that contains a fascinating javascript chart displaying a simple time series. When hovering over the data points on the chart, a popup window reveals the exact value of each point. While I am aware of methods t ...

What are the different ways you can utilize the `Buffer` feature within Electron?

When attempting to implement gray-matter in an electron application, I encountered the error message utils.js:36 Uncaught ReferenceError: Buffer is not defined. Is there a method or workaround available to utilize Buffer within electron? ...

Customize the color of plot points in R highcharter based on their values

I'm diving into the world of highcharts and R highcharter for the first time. Currently, I have a dataframe structured like this: tmp <- data.frame(x = 1:5, y = rnorm(5), color = c("green", "red", "green", "orange", "red")) # x y color # 1 ...

Finding Nested Key Paths in TypeScript for Objects and Arrays

I am in search of a unique method to create a TypeScript type that can take an object type and retrieve all the nested key paths, including properties within arrays as well. I want to exclude any default array properties such as "push" or "pop." While I ha ...

Methods to close the currently active ngx-modal when a new modal is triggered within the same Angular 8 component

I am currently working on developing a versatile modal component that has the ability to be called from within the same modal itself. Is there any way to configure the component and modal in such a manner that when the reusable component is triggered, it ...

Having trouble with passing props in React. Any suggestions on what I might be missing?

It seems like I am facing an issue with passing props in React, and for some reason, it's not functioning as expected. I'm a bit puzzled by the whole situation. Main Application Component import React from 'react' import Produc ...

Devextreme experiences the submission of multiple forms simultaneously

While working with Devextreme forms in Angular 2, I encountered an issue with two separate forms. Whenever I click the submit button on either the first or second form, both forms undergo validation. Why is this happening? https://i.sstatic.net/1orrY.png ...

What is the solution for positioning a checkbox above a label in ngx-formly?

The checkbox control is displayed on top of the label. The control is defined as follows: { key: 'selected', type: 'checkbox', templateOptions: { label: 'Virtual Bollo', indet ...

Acquiring the root URL with the $location service in AngularJS

I am facing a situation where I have a specific URL structure like the one shown below. http://localhost:8080/test#/users/list Upon further investigation, I discovered the following information: $location.url() returns -> "users/list" $location.path( ...

What is the best way to prevent the execution of the else block after breaking out of a loop within an if statement in

Here's what I need help with: I have an array with the following values, {"OPN":0,"INPR":8,"WAIT":2,"STP":1,"RED":13} I need to show a modal window if all keys have a count of 0, except for WAIT. If the count of all keys is greater than 0, then I ne ...

Why is my filtering and sorting function failing to function properly?

I have a collection of events represented by an array of objects, where each event contains a start date and an end date. My goal is to filter out any events that have already passed based on the current time (now), and then sort the remaining events in d ...

The SonarQube [xxx] server appears to be unreachable

I'm currently facing an issue with my SonarQube instance. I have set up a personal SonarQube instance on our VPS using the domain name 'https://sonar.pamwork.com', and it loads correctly on the browser. However, when I try to test my Angular ...

Encountering an error in accessing my own API: "Cannot read property 'then

I'm currently in the process of using my personal express.js API with nodejs. Although it is functioning, I am encountering an error that is preventing me from accessing the response of the request. Below is a snippet of my code: routes.js: app.post ...

The file size exceeds the server's upload limit, despite making changes to the php.ini file

I've encountered a problem trying to upload an .OBJ file to the server, resulting in an 'Error 1' message. The uploaded file surpasses the upload_max_filesize directive specified in php.ini This error is detailed on this page - http://ph ...

What is the best way to declare a TypeScript type with a repetitive structure?

My data type is structured in the following format: type Location=`${number},${number};${number},${number};...` I am wondering if there is a utility type similar to Repeat<T> that can simplify this for me. For example, could I achieve the same resul ...

Bring in a 3-dimensional model using JSONLoader in three.js

I'm facing some challenges with incorporating a simple 3D object created in Maya into my Three.js project using JSONLoader. The object consists of various materials (Lambert and Phong) and different colors. I used Maya to create a .obj file, then Ble ...

What methods can be utilized to enhance the visual appeal of a threejs model

I'm currently working on enhancing the visual quality of my 3D models, aiming for smoother edges and more realistic shadows. To achieve this, I am experimenting with an OBJ file format. Here's the code snippet I'm using to load and display t ...

What is the best way to determine a comprehensive map of every sub-store, their functions, and what data they contain?

Summary: Can all actions with their payloads be automatically grouped by sub-store in a composite store using a single type entity (e.g., interface)? I have implemented a Redux store with multiple sub-stores structured as follows: There is an action setA ...

Is there a way to implement a collapse/expand feature for specific tags in React-Select similar to the "limitTags" prop in Material UI Autocomplete?

Utilizing the Select function within react-select allows me to select multiple values effortlessly. isMulti options={colourOptions} /> I am searching for a way to implement a collapse/expand feature for selected tags, similar to the props fun ...