Disabling a particular row in a datatable IceFace

Disabling a particular row in a datatable IceFace

krishna2088krishna2088 Posts: 1Questions: 1Answers: 0
edited August 2016 in Free community support

I have a screen in which certain data are displayed. I am using datatable option to display the data and rowselector to select the row. If I select any row some option will pop up through which user can manipulate the data(like edit and delete), but i want some data to be non editable.

I have a screen in which i am showing data on month basis, like if current month is August then my page will show previous two months data and the next 10 months data.

Now i want current months and previous two months data to be non editable or disable while selection the row through rowselector.(data screenshot has attached)

Below is the my View page and rowselector function:


<i:dataTable id="ConfigurationOne"
headerClass="dataTableCommonHeader"
headerClasses="table_header"
columnClasses="stringColumn, stringColumn w80"
rowClasses="level2ColorStyle, level1ColorStyle"
value="#{configOneBean.monthsDateList}" var="row" cellpadding="0"
cellspacing="1" columnWidths="50px,100px" rows="25"
width="40%"
onrowmouseover="this.style.cursor='default';this.style.backgroundColor='#F1F1F1'‌​;"
onrowmouseout="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"
>

    <i:column>
        <i:rowSelector value="#{row.selected}" 
            selectionListener="#{configOneBean.rowSelectMonthsListener}" />
        <f:facet name="header">
            <i:outputText value="#{resApp['config.type.code']}" />
        </f:facet>
        <i:panelGroup style="width:200px;overflow:hidden;">
            <i:outputText value="#{row.NRPV_NRPA_CODE}" />
        </i:panelGroup>
    </i:column>

    <i:column>

        <f:facet name="header">
            <i:outputText value="#{resApp['config.type.name']}" />
        </f:facet>
        <i:panelGroup style="width:200px;overflow:hidden;">
            <i:outputText value="#{row.NRPV_CREATED_BY}" />
        </i:panelGroup>
    </i:column>

</i:dataTable>


rowSelector Function :


public void rowSelectMonthsListener(RowSelectorEvent event) {
int selectRow = event.getRow();
initActionMap();
if (event.isSelected()) {

    this.monthsDate = monthsDateList.get(selectRow);
    getAllMonthsAndDate();
    actionMap.put(WorkMode.EDIT_GROUP, true);

} else {

    this.monthsDate = null;
    workMode = WorkMode.EMPTY;
}

}

Answers

  • jLinuxjLinux Posts: 981Questions: 73Answers: 75

    If you can use proper markdown in your posts to highlight the code snippets, it would be easier for everyone else to read (and thus help)

    I'm having a hard time telling if what you're asking for is related to DataTables, or some other plugin. Are you using DataTables editable extension? If so, this should be in that forum category, not free community support.

    If you arent, then what library are you using to make the rows editable?

    I would think all you need to do is some basic logic to add some property/attribute to the rows that can or cant be edited, then check for that property whenever the edit function is called

This discussion has been closed.