【问题标题】:Ng2-smart-table : Use datepicker format in the fieldNg2-smart-table : 在字段中使用 datepicker 格式
【发布时间】:2019-04-11 19:30:15
【问题描述】:

有没有可能我可以在 ng2-smart-table 中使用 datepicker 格式。

jobSettings2: object = {
    columns: [
      {
        displayName: "Job ID",
        valueAs: "JobID",
        align: "left",
        columnWidth: "",
        type: "text",
        required: true
      },  



   <ng2-smart-table id="tableID" class="table table-hover" [settings]="jobSettings" [source]="jobSource" (userRowSelect)="selectjobs($event)"></ng2-smart-table>

【问题讨论】:

    标签: angular typescript angular5 ng2-smart-table


    【解决方案1】:

    对于数据,您可以使用 npm install --save ng-pick-datetime ,这提供了许多功能来玩日期。

    如果你想在 ng2-smart-table 中使用日期选择器,你可以通过它的属性 renderComponent 来完成。

    {
     columns: {
        startDate: {
        title: 'Start Time',
        type: 'custom',
        renderComponent: SmartTableDatepickerRenderComponent,
        width: '250px',
        filter: false,
        sortDirection: 'desc',
        editor: {
          type: 'custom',
          component: SmartTableDatepickerComponent,
        }
      },
      endDate: {
        title: 'End Time',
        type: 'custom',
        renderComponent: SmartTableDatepickerRenderComponent,
        width: '250px',
        filter: false,
        editor: {
          type: 'custom',
          component: SmartTableDatepickerComponent,
          config: {
            placeholder: 'End Time'
          }
        }
      }
     }
    }
    

    听说您必须由另一个组件管理。你必须将该组件渲染为ng2-smart-table

    更多信息请查看link.

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-07-08
      • 2018-06-08
      • 1970-01-01
      • 1970-01-01
      • 2019-01-08
      • 2020-01-03
      • 1970-01-01
      • 2018-12-31
      相关资源
      最近更新 更多