Previous Next JavaScript must be enabled to correctly display this content

## 9.17 Add New Columns in Base Component Table

This topic provides the systematic instructions to perform the basic operations on the selected records.

For adding new columns in base component table to do the following.

1. Create an extended component for the base cca by making these changes in the base accordingly.
2. Changes in base
   In HTML

       <!-- ko if: ifExtension -->
       <componentName-extended data="{{base}}">
       </componentName-extended>
       <!-- /ko -->

   In JS

              self.base
       = this;
             self.ifExtension = ko.observable(false);
             self.connected = function () {         if
       (requirejs.s.contexts._.config.paths['components/componentName-
       extended']) {
                 require(['components/componentName-extended/loader'], function () {
       self.ifExtension(true);
                  });
                }
              }

   .
3. Changes in extended

              self.bindingsApplied = function (context) {
       context.props.then(function (properties) {
       console.log(properties.data.columnArray);
                  properties.data.columnArrray.splice(columnIndex, 0, {
       headerText: "Manager Id",                               field: "ManagerId"
                });
       tableId.refresh(properties.data.columnArray);
               });

4. Changes needed at service level.

   For data inside table, custom projection service had to be written, custom events needs to be raised while custom fields persistence. For base fields, a call can be made from projection service to base service to fetch data and persisting the same over projection schema.

Parent topic: Extensibility Use Cases for OBX