Grid Index Incrementation

Hi,
I been hunting for the grid index code. 1, 2 ,3 that gets set. I need to increment with 10s based on customers. Like 10, 20 , 30…

SOmeone point me to it?

@vivek there is a field named idx which is used to set grid index. can you elaborate on what you are trying to achieve so that i can suggest better.

@neilLasrado - For certain customers, they only take in documents like DO, Packing list etc with the item lines numbered as follows

10. Item 1
20. Item 2
30. Item 3

Instead of the normal

  1. Item 1
  2. Item 2
  3. Item 3

I need to increment the idx with +10 instead of + 1 . This is a common requirement with certain MNC companies like KBR. So I am trying to add code to increment with + 10 for selected customers.

I would like to share this ones i code this. It could be useful in the core package.

@neilLasrado I am having a little hard time figuring out the idx. WOuld you ellaborate a bit on this? in context with my requirment? Thank you!

I was thinking of creating a custom field whose value would be = doc.idx*10. But how would I hide the standard row-index?

@vivek even i am not sure on how you could achieve this. Maybe @anand could help you on this.

@vivek

You will have to hide idx values in the UI using jquery selector ‘.row-index’ and by using $(this.frm.wrapper).on("grid-row-render", function() { })

1 Like

@anand is the idx used for anything else other than to number? What if I change the idx + 1 to idx + 10 in the core code? will it break anything?

Yes it might break the sorting in display. I would recommend storing your modifications in a custom field and just display it in the UI.

I been learning the grid code , but I better thought to leave it alone till i have a complete comprehension as a walk around for now I just added d.dx*10 in the standard_macro.html which for now works :smiley: thank you guys. @neilLasrado @anand