Conditionally enable edit in lightning:datatableCustom html label in lightning:buttonWinter 18 <lightning:datatable> problemsSpring 18 <lightning:datatable> how to add a button columnlightning:datatable component - hiding Save and Cancel buttons after inline editHelp with working with lightning:dataTable?Reload after “e.force:editRecord”?Conditionally Render Button in lightning:datatablelightning:datatable set columns dynamicalyStatic values for `<lightning:datatable>`lightning:datatable won't show data in column with type of 'boolean'

Is there really no use for MD5 anymore?

Can a level 2 Warlock take one level in rogue, then continue advancing as a warlock?

How long after the last departure shall the airport stay open for an emergency return?

Do I need to watch Ant-Man and the Wasp and Captain Marvel before watching Avengers: Endgame?

What to do with someone that cheated their way through university and a PhD program?

Is Diceware more secure than a long passphrase?

Why do games have consumables?

What *exactly* is electrical current, voltage, and resistance?

Apply a different color ramp to subset of categorized symbols in QGIS?

Island of Knights, Knaves and Spies

I preordered a game on my Xbox while on the home screen of my friend's account. Which of us owns the game?

Prove that the countable union of countable sets is also countable

How to run Arduino codes in Java netbeans?

Mistake in years of experience in resume?

Is Electric Central Heating worth it if using Solar Panels?

Older movie/show about humans on derelict alien warship which refuels by passing through a star

Why does Arg'[1. + I] return -0.5?

How do I prove this combinatorial identity

How to have a sharp product image?

How can I wire a 9-position switch so that each position turns on one more LED than the one before?

Negative Resistance

Could moose/elk survive in the Amazon forest?

Why do real positive eigenvalues result in an unstable system? What about eigenvalues between 0 and 1? or 1?

What was Apollo 13's "Little Jolt" after MECO?



Conditionally enable edit in lightning:datatable


Custom html label in lightning:buttonWinter 18 <lightning:datatable> problemsSpring 18 <lightning:datatable> how to add a button columnlightning:datatable component - hiding Save and Cancel buttons after inline editHelp with working with lightning:dataTable?Reload after “e.force:editRecord”?Conditionally Render Button in lightning:datatablelightning:datatable set columns dynamicalyStatic values for `<lightning:datatable>`lightning:datatable won't show data in column with type of 'boolean'






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















I'm trying to do a dynamic editable field, this is what I've got:



Component



<lightning:datatable columns="!v.columns"
data="! v.data "
keyField="! v.keyField "
onsave="! c.handleSaveEdition "
/>


data



[
field1: 't1c1', field2: 't1c2', field3: 't1c3', field3Editable: true,
field1: 't2c1', field2: 't2c2', field3: 't3c3', field3Editable: true,
field1: 't2c1', field2: 't2c2', field3: 't3c3', field3Editable: false,
];


column



[
label: 'Col 1', fieldName: 'field1', type: 'text', sortable: false,
label: 'Col 2', fieldName: 'field2', type: 'text', sortable: false,
label: 'Col 3', fieldName: 'field3', type: 'text', sortable: false, editable: fieldName: 'field3Editable',
];


but even with the last "field3Editable" from data seted as false the field appears as editable.










share|improve this question






























    1















    I'm trying to do a dynamic editable field, this is what I've got:



    Component



    <lightning:datatable columns="!v.columns"
    data="! v.data "
    keyField="! v.keyField "
    onsave="! c.handleSaveEdition "
    />


    data



    [
    field1: 't1c1', field2: 't1c2', field3: 't1c3', field3Editable: true,
    field1: 't2c1', field2: 't2c2', field3: 't3c3', field3Editable: true,
    field1: 't2c1', field2: 't2c2', field3: 't3c3', field3Editable: false,
    ];


    column



    [
    label: 'Col 1', fieldName: 'field1', type: 'text', sortable: false,
    label: 'Col 2', fieldName: 'field2', type: 'text', sortable: false,
    label: 'Col 3', fieldName: 'field3', type: 'text', sortable: false, editable: fieldName: 'field3Editable',
    ];


    but even with the last "field3Editable" from data seted as false the field appears as editable.










    share|improve this question


























      1












      1








      1








      I'm trying to do a dynamic editable field, this is what I've got:



      Component



      <lightning:datatable columns="!v.columns"
      data="! v.data "
      keyField="! v.keyField "
      onsave="! c.handleSaveEdition "
      />


      data



      [
      field1: 't1c1', field2: 't1c2', field3: 't1c3', field3Editable: true,
      field1: 't2c1', field2: 't2c2', field3: 't3c3', field3Editable: true,
      field1: 't2c1', field2: 't2c2', field3: 't3c3', field3Editable: false,
      ];


      column



      [
      label: 'Col 1', fieldName: 'field1', type: 'text', sortable: false,
      label: 'Col 2', fieldName: 'field2', type: 'text', sortable: false,
      label: 'Col 3', fieldName: 'field3', type: 'text', sortable: false, editable: fieldName: 'field3Editable',
      ];


      but even with the last "field3Editable" from data seted as false the field appears as editable.










      share|improve this question
















      I'm trying to do a dynamic editable field, this is what I've got:



      Component



      <lightning:datatable columns="!v.columns"
      data="! v.data "
      keyField="! v.keyField "
      onsave="! c.handleSaveEdition "
      />


      data



      [
      field1: 't1c1', field2: 't1c2', field3: 't1c3', field3Editable: true,
      field1: 't2c1', field2: 't2c2', field3: 't3c3', field3Editable: true,
      field1: 't2c1', field2: 't2c2', field3: 't3c3', field3Editable: false,
      ];


      column



      [
      label: 'Col 1', fieldName: 'field1', type: 'text', sortable: false,
      label: 'Col 2', fieldName: 'field2', type: 'text', sortable: false,
      label: 'Col 3', fieldName: 'field3', type: 'text', sortable: false, editable: fieldName: 'field3Editable',
      ];


      but even with the last "field3Editable" from data seted as false the field appears as editable.







      lightning-aura-components lightning lightning-datatable






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 2 hours ago









      Jayant Das

      19.4k21331




      19.4k21331










      asked 3 hours ago









      M. MassulaM. Massula

      262




      262




















          1 Answer
          1






          active

          oldest

          votes


















          3














          Per documentation, the editable attribute for lightning:datatable is applicable directly at the column level, and it does not mention anything at cell level, excerpt below:




          Specifies whether a column supports inline editing. The default is false.




          With a quick test, I could confirm that you won't be able to disable a particular cell in a lightning:datatable with the syntax you have currently. With what you have currently editable: fieldName: 'field3Editable' is not the right syntax based on the documentation. The attribute itself should be set to editable: true or editable: false.



          The syntax that you have currently seems to be always evaluated as editable: true by the platform, most likely it simply ignores any error and sets it to true. Even if you say have something as editable: nonExistentFieldName: 'nonExistentFieldValue' you will be still able to see that the cells are editable.



          If you want to disable any particular cell, you may have to look at alternative solutions here as you may not be able to achieve it using lightning:datatable.






          share|improve this answer























            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "459"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f260099%2fconditionally-enable-edit-in-lightningdatatable%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            3














            Per documentation, the editable attribute for lightning:datatable is applicable directly at the column level, and it does not mention anything at cell level, excerpt below:




            Specifies whether a column supports inline editing. The default is false.




            With a quick test, I could confirm that you won't be able to disable a particular cell in a lightning:datatable with the syntax you have currently. With what you have currently editable: fieldName: 'field3Editable' is not the right syntax based on the documentation. The attribute itself should be set to editable: true or editable: false.



            The syntax that you have currently seems to be always evaluated as editable: true by the platform, most likely it simply ignores any error and sets it to true. Even if you say have something as editable: nonExistentFieldName: 'nonExistentFieldValue' you will be still able to see that the cells are editable.



            If you want to disable any particular cell, you may have to look at alternative solutions here as you may not be able to achieve it using lightning:datatable.






            share|improve this answer



























              3














              Per documentation, the editable attribute for lightning:datatable is applicable directly at the column level, and it does not mention anything at cell level, excerpt below:




              Specifies whether a column supports inline editing. The default is false.




              With a quick test, I could confirm that you won't be able to disable a particular cell in a lightning:datatable with the syntax you have currently. With what you have currently editable: fieldName: 'field3Editable' is not the right syntax based on the documentation. The attribute itself should be set to editable: true or editable: false.



              The syntax that you have currently seems to be always evaluated as editable: true by the platform, most likely it simply ignores any error and sets it to true. Even if you say have something as editable: nonExistentFieldName: 'nonExistentFieldValue' you will be still able to see that the cells are editable.



              If you want to disable any particular cell, you may have to look at alternative solutions here as you may not be able to achieve it using lightning:datatable.






              share|improve this answer

























                3












                3








                3







                Per documentation, the editable attribute for lightning:datatable is applicable directly at the column level, and it does not mention anything at cell level, excerpt below:




                Specifies whether a column supports inline editing. The default is false.




                With a quick test, I could confirm that you won't be able to disable a particular cell in a lightning:datatable with the syntax you have currently. With what you have currently editable: fieldName: 'field3Editable' is not the right syntax based on the documentation. The attribute itself should be set to editable: true or editable: false.



                The syntax that you have currently seems to be always evaluated as editable: true by the platform, most likely it simply ignores any error and sets it to true. Even if you say have something as editable: nonExistentFieldName: 'nonExistentFieldValue' you will be still able to see that the cells are editable.



                If you want to disable any particular cell, you may have to look at alternative solutions here as you may not be able to achieve it using lightning:datatable.






                share|improve this answer













                Per documentation, the editable attribute for lightning:datatable is applicable directly at the column level, and it does not mention anything at cell level, excerpt below:




                Specifies whether a column supports inline editing. The default is false.




                With a quick test, I could confirm that you won't be able to disable a particular cell in a lightning:datatable with the syntax you have currently. With what you have currently editable: fieldName: 'field3Editable' is not the right syntax based on the documentation. The attribute itself should be set to editable: true or editable: false.



                The syntax that you have currently seems to be always evaluated as editable: true by the platform, most likely it simply ignores any error and sets it to true. Even if you say have something as editable: nonExistentFieldName: 'nonExistentFieldValue' you will be still able to see that the cells are editable.



                If you want to disable any particular cell, you may have to look at alternative solutions here as you may not be able to achieve it using lightning:datatable.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 2 hours ago









                Jayant DasJayant Das

                19.4k21331




                19.4k21331



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Salesforce Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f260099%2fconditionally-enable-edit-in-lightningdatatable%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Ружовы пелікан Змест Знешні выгляд | Пашырэнне | Асаблівасці біялогіі | Літаратура | НавігацыяДагледжаная версіяправерана1 зменаДагледжаная версіяправерана1 змена/ 22697590 Сістэматыкана ВіківідахВыявына Вікісховішчы174693363011049382

                    ValueError: Error when checking input: expected conv2d_13_input to have shape (3, 150, 150) but got array with shape (150, 150, 3)2019 Community Moderator ElectionError when checking : expected dense_1_input to have shape (None, 5) but got array with shape (200, 1)Error 'Expected 2D array, got 1D array instead:'ValueError: Error when checking input: expected lstm_41_input to have 3 dimensions, but got array with shape (40000,100)ValueError: Error when checking target: expected dense_1 to have shape (7,) but got array with shape (1,)ValueError: Error when checking target: expected dense_2 to have shape (1,) but got array with shape (0,)Keras exception: ValueError: Error when checking input: expected conv2d_1_input to have shape (150, 150, 3) but got array with shape (256, 256, 3)Steps taking too long to completewhen checking input: expected dense_1_input to have shape (13328,) but got array with shape (317,)ValueError: Error when checking target: expected dense_3 to have shape (None, 1) but got array with shape (7715, 40000)Keras exception: Error when checking input: expected dense_input to have shape (2,) but got array with shape (1,)

                    Illegal assignment from SObject to ContactFetching String, Id from Map - Illegal Assignment Id to Field / ObjectError: Compile Error: Illegal assignment from String to BooleanError: List has no rows for assignment to SObjectError on Test Class - System.QueryException: List has no rows for assignment to SObjectRemote action problemDML requires SObject or SObject list type error“Illegal assignment from List to List”Test Class Fail: Batch Class: System.QueryException: List has no rows for assignment to SObjectMapping to a user'List has no rows for assignment to SObject' Mystery