1

I have tried using the show-row-number-column = "false" attribute but it does not seem to work.

https://developer.salesforce.com/docs/component-library/bundle/lightning-datatable/specification

    <div class="slds-m-around_medium">
        <template if:true={voting}>
            <lightning-datatable
                key-field="Id"
                hide-checkbox-column = "true"
                data={voting}
                columns={columns}
                onsave={handleSave} 
                show-row-number-column = "false"  
                draft-values={draftValues}>
            </lightning-datatable>
        </template>
        <template if:true={voting}>
            <!-- handle Apex error -->
        </template>
    </div>
3

The attribute show-row-number-column set automatically to "true" if present we dont need to set it to "true" or "false" if you dont want row number Simply remove that attribute

  <lightning-datatable
                key-field="Id"
                hide-checkbox-column = "true"
                data={voting}
                columns={columns}
                onsave={handleSave} 

                draft-values={draftValues}>
            </lightning-datatable>

Also if the columns are editable,the show-row-number-column attribute is always true and the number column is displayed.

  • 2
    Confirming that this is true based on what I'm seeing: "if the columns are editable,the show-row-number-column attribute is always true". Seems kind of dumb, but there you go. – Matthew Souther Nov 7 '20 at 6:44
0

"show-row-number-column= false" property from Lightning datatable will work, Please post your code snippet for better analysis.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.