IC SunsetThe developerWorks Connections platform will be sunset on December 31, 2019. On January 1, 2020, this community and its apps will no longer be available. More details available on our FAQ.
Topic
  • 4 replies
  • Latest Post - ‏2015-09-22T00:44:22Z by Sandeep_I
koori
koori
28 Posts

Pinned topic column level sorting is not working on contentlist using SamplePluginFeature

‏2013-10-23T15:36:45Z | ecmhv ecmsupport icn

Currently am able to modify the samplePlugin to customize the search & UI in ICN 2.0.2 using SamplePluginFeature and able to search a documents & display the results on the content list  and facing a column level sorting issue on SamplePluginFeature

  • column level sorting is not working when you click on the columns from contentlist  (already set the sortable column property as true on JSONResultSetColumn)

why column level sorting is not working on SamplePluginFeature? can you please help me on this issue?

  • BJOwings
    BJOwings
    185 Posts
    ACCEPTED ANSWER

    Re: column level sorting is not working on contentlist using SamplePluginFeature

    ‏2013-11-04T17:50:44Z  

    After looking at this issue it appears to be due to errant logic in ecm.model.ResultsSet.doSort.  There is a test at the beginning of that function that is causing the sort to be skipped if there is neither a parentFolder nor a searchTemplate.  It is something that should be addressed in the ResultSet logic, but you should be able to work around the problem by setting some value for the searchTemplate.  I did the following change in SampleFeaturePane.js at about line 233 and sort appears to work:

    var resultSet = new ResultSet(response);
    resultSet.searchTemplate = "abc";  // to work around an issue in ResultSet.doSort
    this.searchResults.setResultSet(resultSet);

     

     

  • BJOwings
    BJOwings
    185 Posts

    Re: column level sorting is not working on contentlist using SamplePluginFeature

    ‏2013-11-04T17:50:44Z  

    After looking at this issue it appears to be due to errant logic in ecm.model.ResultsSet.doSort.  There is a test at the beginning of that function that is causing the sort to be skipped if there is neither a parentFolder nor a searchTemplate.  It is something that should be addressed in the ResultSet logic, but you should be able to work around the problem by setting some value for the searchTemplate.  I did the following change in SampleFeaturePane.js at about line 233 and sort appears to work:

    var resultSet = new ResultSet(response);
    resultSet.searchTemplate = "abc";  // to work around an issue in ResultSet.doSort
    this.searchResults.setResultSet(resultSet);

     

     

  • koori
    koori
    28 Posts

    Re: column level sorting is not working on contentlist using SamplePluginFeature

    ‏2013-11-04T21:31:56Z  
    • BJOwings
    • ‏2013-11-04T17:50:44Z

    After looking at this issue it appears to be due to errant logic in ecm.model.ResultsSet.doSort.  There is a test at the beginning of that function that is causing the sort to be skipped if there is neither a parentFolder nor a searchTemplate.  It is something that should be addressed in the ResultSet logic, but you should be able to work around the problem by setting some value for the searchTemplate.  I did the following change in SampleFeaturePane.js at about line 233 and sort appears to work:

    var resultSet = new ResultSet(response);
    resultSet.searchTemplate = "abc";  // to work around an issue in ResultSet.doSort
    this.searchResults.setResultSet(resultSet);

     

     

    thanks a lot Brian and it's working as expected

  • PiGG
    PiGG
    71 Posts

    Re: column level sorting is not working on contentlist using SamplePluginFeature

    ‏2014-07-29T15:47:43Z  
    • BJOwings
    • ‏2013-11-04T17:50:44Z

    After looking at this issue it appears to be due to errant logic in ecm.model.ResultsSet.doSort.  There is a test at the beginning of that function that is causing the sort to be skipped if there is neither a parentFolder nor a searchTemplate.  It is something that should be addressed in the ResultSet logic, but you should be able to work around the problem by setting some value for the searchTemplate.  I did the following change in SampleFeaturePane.js at about line 233 and sort appears to work:

    var resultSet = new ResultSet(response);
    resultSet.searchTemplate = "abc";  // to work around an issue in ResultSet.doSort
    this.searchResults.setResultSet(resultSet);

     

     

    Bingo!  This one line saved me from days of stress, pressure and possibly my job. Thank you so much for the question and answer. 

    resultSet.searchTemplate = "abc";

     

     

  • AmirFarah
    AmirFarah
    28 Posts

    Re: column level sorting is not working on contentlist using SamplePluginFeature

    ‏2014-08-24T12:10:32Z  
    • BJOwings
    • ‏2013-11-04T17:50:44Z

    After looking at this issue it appears to be due to errant logic in ecm.model.ResultsSet.doSort.  There is a test at the beginning of that function that is causing the sort to be skipped if there is neither a parentFolder nor a searchTemplate.  It is something that should be addressed in the ResultSet logic, but you should be able to work around the problem by setting some value for the searchTemplate.  I did the following change in SampleFeaturePane.js at about line 233 and sort appears to work:

    var resultSet = new ResultSet(response);
    resultSet.searchTemplate = "abc";  // to work around an issue in ResultSet.doSort
    this.searchResults.setResultSet(resultSet);

     

     

    Saved My Day with this Fix

    Thanks

    Amir Farah

  • Bob Kranson
    Bob Kranson
    60 Posts

    Re: column level sorting is not working on contentlist using SamplePluginFeature

    ‏2014-12-02T19:24:16Z  
    • BJOwings
    • ‏2013-11-04T17:50:44Z

    After looking at this issue it appears to be due to errant logic in ecm.model.ResultsSet.doSort.  There is a test at the beginning of that function that is causing the sort to be skipped if there is neither a parentFolder nor a searchTemplate.  It is something that should be addressed in the ResultSet logic, but you should be able to work around the problem by setting some value for the searchTemplate.  I did the following change in SampleFeaturePane.js at about line 233 and sort appears to work:

    var resultSet = new ResultSet(response);
    resultSet.searchTemplate = "abc";  // to work around an issue in ResultSet.doSort
    this.searchResults.setResultSet(resultSet);

     

     

    Thank you, thank you!  It does fix the sorting.  This errant logic is still present in fix pack 6 for 2.0.2 so the searchTemplate value still is required in 2.0.2 fp6.