question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error on show view vs. edit view

See original GitHub issue

I’m getting an error with the following field on ‘show view’ only. Works just fine in ‘edit view’. Any idea what I’m doing wrong?

TypeError: Cannot read property 'updated_date' of undefined
    at p.n.getInput (maField.js:25)
    at p.n.fieldHasValidation (maField.js:36)
    at p.n.getFieldValidationClass (maField.js:46)
    at Object.get (angular.js:12474)
    at p.$digest (angular.js:14404)
    at angular.js:14609
    at o (angular.js:4940)
    at angular.js:5328
    user.editionView()
        .title('Edit User')
        .fields(
        nga.field('updated_date', 'datetime')
            .label('Updated Date')
            .format('medium')
            .editable(false)
            .template(maFieldTemplate('updated_date'), true),
            user.creationView().fields()
        );

    user.showView()
        .title('User')
        .fields(user.editionView().fields());
function maFieldTemplate(value)
{
    return '<ma-field ng-if="entry.values.' + value +
            ' !== undefined && entry.values.' + value +
            ' !== null && entry.values.' + value +
            ' !== \'0\'" field="::field" value="entry.values[field.name()]" entry="entry" entity="::entity" form="formController.form" datastore="::formController.dataStore"></ma-field>';
}

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
jamespsterlingcommented, Mar 3, 2016

Thanks for the tip!

One more question, I’m getting and error trying ma-column. Any idea what I’m doing wrong?

TypeError: Cannot read property 'isReadOnly' of undefined
    at o (http://classcode.corp.york-claims.com/scripts/vendor/ng-admin.min.js:15:25168)
    at link (http://classcode.corp.york-claims.com/scripts/vendor/ng-admin.min.js:15:26021)
    at http://classcode.corp.york-claims.com/scripts/vendor/ng-admin.min.js:25:3694
    at ae (http://classcode.corp.york-claims.com/scripts/vendor/ng-admin.min.js:25:3751)
    at w (http://classcode.corp.york-claims.com/scripts/vendor/ng-admin.min.js:24:29868)
    at s (http://classcode.corp.york-claims.com/scripts/vendor/ng-admin.min.js:24:25689)
    at http://classcode.corp.york-claims.com/scripts/vendor/ng-admin.min.js:24:25185
    at F.i (http://classcode.corp.york-claims.com/scripts/vendor/ng-admin.min.js:24:26180)
    at c (http://classcode.corp.york-claims.com/scripts/vendor/ng-admin.min.js:24:28361)
    at Object.fn (http://classcode.corp.york-claims.com/scripts/vendor/ng-admin.min.js:27:18314) <ma-column ng-if="entry.values.updated_date !== undefined  &amp;&amp; entry.values.updated_date !== null  &amp;&amp; entry.values.updated_date !== '0'  &amp;&amp; entry.values.updated_date !== ''" field="::field" value="entry.values[field.name()]" entry="entry" entity="::entity" form="formController.form" datastore="::formController.dataStore">

This is my function.

function maColumnTemplate(value)
{
    return '<ma-column ng-if="entry.values.' + value + ' !== undefined ' +
            ' && entry.values.' + value + ' !== null ' +
            ' && entry.values.' + value + ' !== \'0\' ' +
            ' && entry.values.' + value + ' !== \'\'" ' +
            ' field="::field" value="entry.values[field.name()]" entry="entry" entity="::entity" form="formController.form" datastore="::formController.dataStore"></ma-column>';
}

And this is how it’s used,

        nga.field('created_by_id', 'reference')
            .label('Created By')
            .targetEntity(users)
            .targetField(nga.field('name'))
            .template(maColumnTemplate('created_by_id'), true),
0reactions
jamespsterlingcommented, Aug 29, 2016

@taraujoz having the same issue currently. Are you transforming your data at all in RestangularProvider.addResponseInterceptor(...) method?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error when trying to edit SharePoint View
I am trying to edit a view in my SharePoint List. When I select edit current view, I get an error. When I...
Read more >
Show Error on the tip of the Edit Text Android
When any view get focus, you are setting no error and when focus changed, you check whether there is valid input or not...
Read more >
User and Workspace Settings - Visual Studio Code
User and Workspace Settings. You can configure Visual Studio Code to your liking through its various settings. Nearly every part of VS Code's...
Read more >
Unable to edit account settings or add a new view
To edit account settings or add a new view, you need to have the Editor role. If you do not have this permission...
Read more >
How to fix the Office 365 Mac editing error
By far, the most common reason for “Your account can view documents but it doesn't allow editing on a Mac” error is having...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found