Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to modify "list form" template for every model? #45

Closed
wahono77 opened this issue Aug 28, 2014 · 1 comment
Closed

How to modify "list form" template for every model? #45

wahono77 opened this issue Aug 28, 2014 · 1 comment

Comments

@wahono77
Copy link

image

I want to change only first column has a link to edit, but others column is painted as normal label.

In second columns, that is a column with type String and use editor: 'ckEditor'.

My test models is :

'use strict';

var mongoose = require('mongoose');
var Schema = mongoose.Schema;

var ProductCategorySchema = new Schema({
Name: {
type: String,
required: true,
index: true,
list:true,
form: {label: 'Product Category'}
},
Description: {
type: String,
list:true,
form: {
type: 'textarea',
editor: 'ckEditor',
label: 'Description'
}
},
ParentCategory: {
type: Schema.Types.ObjectId,
ref: 'ProductCategory',
list:true,
form: {
label: 'Parent Category',
help: 'For root category, leave this field blank!'
}
},
Status: {
type: Boolean,
default: true,
list:true,
},
CreatedAt: {
type: Date,
readonly: true,
default: Date.now,
form: {hidden: true}
}
});

var ProductCategory = mongoose.model('ProductCategory', ProductCategorySchema);

module.exports = ProductCategory;

This is my test of your great project for today.

Thanks in advance

@mchapman
Copy link
Member

The best way to do that would be to set up a specific route that uses a modified partial based on base_list.html. Something along the lines of

formsAngular.config(['routingServiceProvider', function (routingService) {
  routingService.start({
    routing: 'ngroute',
    html5Mode: true, 
    prefix:'/data'
    fixedRoutes: [
      {route: '/data/ProductCategory', options: {templateUrl: 'partials/ProdCatList.html'}},
    ]
  });

and make the necessary edits to the infinite scroll section of your ProdCatList.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants