Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    ListGridFieldType.LINK on integer data types

    Hi,

    For the List Grid to be able to use LINK cell renderers, the column type must be text.
    However I have a column type as integer and I would like to use the LINK type for it.

    What is the alternative?

    Thanks
    Jonny

    #2
    I've been playing with the samples on showcase and got an alternative solution, which is not quite nice.

    Overriding the "createRecordComponent" method, and adding a LinkItem field type works, but it looks like an underlined font, instead of a hyperlink.

    So, the real question becomes, can I convert other data types (integer) to text for as part of overriding some method on the grid?

    I guess it's the createRecordComponent method itself, but I'm not sure what I would return as part of that method.

    Code:
    grid = new ListGrid()
    {
        @Override
        protected Canvas createRecordComponent(ListGridRecord record, Integer colNum) {
    	String fieldName = this.getFieldName(colNum);  
    	if (fieldName.equals("classID"))
    	{
                  // what should go here?
            }
    };
    
     ListGridField onOrderField = new ListGridField("classID", "CLAAASSSSS", 50);
     onOrderField.setType(ListGridFieldType.LINK);
    I can be way off, but indicate what's the path I should take.

    thanks.

    Comment


      #3
      Hi Admin, Please do needful as i have a Integer field and also this field is having LINK on it and sorting doestn't working for this.

      Comment


        #4
        I am getting below error in browsers console.


        isc.B.push.isc.A.addToMasterLog @ ISC_Core.js:1156
        isc_c_Log_addLogMessage @ ISC_Core.js:1155
        isc_c_Log_log @ ISC_Core.js:1148
        logMessage @ ISC_Core.js:1137
        logWarn @ ISC_Core.js:1137
        isc__debug__reportJSErrorStack @ ISC_Core.js:1110
        isc__debug__reportJSError @ ISC_Core.js:1110
        isc_c_Class_fireCallback @ ISC_Core.js:306
        isc_c_Timer__fireTimeout @ ISC_Core.js:1437
        (anonymous) @ ISC_Core.js:1434
        ISC_Core.js:306 Uncaught TypeError: _10.replaceAll is not a function
        at Object.isc_ListGrid__formatLinkCellValue [as $31r] (ISC_Grids.js:923)
        at _3.isc_ListGrid_applyCellTypeFormatters [as applyCellTypeFormatters] (ISC_Grids.js:1528)
        at _3.isc_ListGrid__formatCellValue [as $315] (ISC_Grids.js:1520)
        at _3.isc_ListGrid_getCellValue [as getCellValue] (ISC_Grids.js:1475)
        at _3.eval [as getCellValue] (eval at isc__makeFunction (ISC_Core.js:79), <anonymous>:4:115)
        at _3.isc_GridRenderer__getCellValue [as $22k] (ISC_Grids.js:522)
        at _3.isc_GridRenderer_getTableHTML [as getTableHTML] (ISC_Grids.js:476)
        at _3.isc_GridRenderer_getInnerHTML [as getInnerHTML] (ISC_Grids.js:366)
        at _3.isc_c_Class_invokeSuper [as invokeSuper] (ISC_Core.js:297)
        at _3.isc_c_Class_Super [as Super] (ISC_Core.js:289)
        at _3.isc_GridBody_getInnerHTML [as getInnerHTML] (ISC_Grids.js:793)
        at _3.isc_Canvas__getInnerHTML [as $px] (ISC_Core.js:2180)
        at _3.isc_Canvas__updateInnerHTML [as $rd] (ISC_Core.js:2287)
        at _3.isc_c_Class_invokeSuper [as invokeSuper] (ISC_Core.js:297)
        at _3.isc_GridRenderer__updateInnerHTML [as $rd] (ISC_Grids.js:394)
        at _3.isc_Canvas__updateHTML [as $ra] (ISC_Core.js:2280)
        at _3.isc_Canvas_redraw [as redraw] (ISC_Core.js:2273)
        at _3.isc_c_Class_invokeSuper [as invokeSuper] (ISC_Core.js:297)
        at _3.isc_GridRenderer_redraw [as redraw] (ISC_Grids.js:750)
        at _3.isc_c_Class_invokeSuper [as invokeSuper] (ISC_Core.js:297)
        at _3.isc_GridBody_redraw [as redraw] (ISC_Grids.js:831)
        at _3.isc_Canvas_redrawChildren [as redrawChildren] (ISC_Core.js:2287)
        at _3.isc_Canvas__updateHTML [as $ra] (ISC_Core.js:2280)
        at _3.isc_Canvas_redraw [as redraw] (ISC_Core.js:2273)
        at _3.isc_c_Class_invokeSuper [as invokeSuper] (ISC_Core.js:297)
        at _3.isc_ListGrid_redraw [as redraw] (ISC_Grids.js:1080)
        at _3.isc_Canvas_redrawChildren [as redrawChildren] (ISC_Core.js:2287)
        at _3.isc_Canvas__updateHTML [as $ra] (ISC_Core.js:2280)
        at _3.isc_Canvas_redraw [as redraw] (ISC_Core.js:2273)
        at _3.isc_Canvas_redrawChildren [as redrawChildren] (ISC_Core.js:2287)
        at _3.isc_Canvas__updateHTML [as $ra] (ISC_Core.js:2280)
        at _3.isc_Canvas_redraw [as redraw] (ISC_Core.js:2273)
        at _3.isc_Canvas_redrawChildren [as redrawChildren] (ISC_Core.js:2287)
        at _3.isc_Canvas__updateHTML [as $ra] (ISC_Core.js:2280)
        at _3.isc_Canvas_redraw [as redraw] (ISC_Core.js:2273)
        at _3.isc_Canvas_redrawChildren [as redrawChildren] (ISC_Core.js:2287)
        at _3.isc_Canvas__updateHTML [as $ra] (ISC_Core.js:2280)
        at _3.isc_Canvas_redraw [as redraw] (ISC_Core.js:2273)
        at _3.isc_Canvas_redrawChildren [as redrawChildren] (ISC_Core.js:2287)
        at _3.isc_Canvas__updateHTML [as $ra] (ISC_Core.js:2280)
        at _3.isc_Canvas_redraw [as redraw] (ISC_Core.js:2273)
        at _3.isc_Canvas_redrawChildren [as redrawChildren] (ISC_Core.js:2287)
        at _3.isc_Canvas__updateHTML [as $ra] (ISC_Core.js:2280)
        at _3.isc_Canvas_redraw [as redraw] (ISC_Core.js:2273)
        at Object.isc_c_Canvas_clearRedrawQueue [as clearRedrawQueue] (ISC_Core.js:3214)
        at _3.isc_c_Class_fireCallback [as fireCallback] (ISC_Core.js:306)
        at _3.isc_c_Timer__fireTimeout [as $in] (ISC_Core.js:1437)
        at ISC_Core.js:1434

        Comment


          #5
          I have this field and i have set LINK to this and also in ds.xml -> <field name="creditMemoNumber" type="integer" align="center" />.


          ListGridField creditMemoNumber = new ListGridField(CREDIT_MEMO_NUMBER_FIELD,
          MESSAGES.getCreditMemoNumber());
          creditMemoNumber.setMinWidth(100);
          creditMemoNumber.setType(ListGridFieldType.LINK);
          creditMemoNumber.setAttribute("target", "javascript");

          Comment


            #6
            We've made a change to address this issue - please retest with the latest build from smartclient.com/builds.

            Comment

            Working...
            X