NetTalk Central

Author Topic: How to refresh a browse cell using Ajax  (Read 4710 times)

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
How to refresh a browse cell using Ajax
« on: August 15, 2020, 07:17:26 AM »
Hi, Im trying to refresh a browse cell using ajax.
I can GET the value from the server but the problem is how to identify the id of the cell I must update.
In the attached pic you can see CVH in column 1 , using it I ask the server its price that I need to update in column 4
To update the price I need to know the cell id.
The ids seams to be divxxxxxxx_div where xxxxxxxx is a random number.
Is there any way to set the ids a different way so I can have a relation between CVH and its price cell?
Thanks
-----------
Regards
Alberto

bshields

  • Sr. Member
  • ****
  • Posts: 392
    • View Profile
    • Inhabit
    • Email
Re: How to refresh a browse cell using Ajax
« Reply #1 on: August 15, 2020, 04:55:54 PM »
Hi,

I cannot see your picture. But i know what you are trying to do.

The best way to generate the contents of a cell in a browse is to use the original browse to do it. Then you don't need to know the div id as the browser knows it.

DO value::YourFieldName

Will do it. I expect you'll need to pass an event to the browse to get it to refresh the value for you.

I'd suggest creating a simple browse and utilise the existing fresh cell option to check what events are passed. Once you see that, you can do the same thing.

Regards
Bill

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: How to refresh a browse cell using Ajax
« Reply #2 on: August 16, 2020, 06:47:49 AM »
Thanks bshields, here goes the picture, I dont want to refresh all the browse, it can be done using NetRefresh and works ok but it is slow.
May be I dont understand what you mean because there are many ::YourFieldName, one per row.
« Last Edit: August 16, 2020, 06:58:53 AM by michelis »
-----------
Regards
Alberto

bshields

  • Sr. Member
  • ****
  • Posts: 392
    • View Profile
    • Inhabit
    • Email
Re: How to refresh a browse cell using Ajax
« Reply #3 on: August 16, 2020, 03:59:56 PM »
Hi,

You can refresh only a cell. Each uniquely named div can be refreshed independently.

The code that generates the contents of the cell is DO value::YourFieldName.

You just have to watch how NT does it and do the same.

I've attached a screen cap of the place where NT does it.

Regards
Bill

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: How to refresh a browse cell using Ajax
« Reply #4 on: August 17, 2020, 04:39:03 AM »
Hi, where is this window from?
In my Browse and in my fields I dont find any settings like this, see pic.
-----------
Regards
Alberto

ntnewbies

  • Full Member
  • ***
  • Posts: 184
    • View Profile
    • Email
Re: How to refresh a browse cell using Ajax
« Reply #5 on: August 19, 2020, 03:30:39 AM »
hi alberto

the screen that bill put appears only when you use button - other button


jason

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: How to refresh a browse cell using Ajax
« Reply #6 on: August 20, 2020, 10:04:00 AM »
This is the function to know the id

p_web.DivHeader('bCotizaciones_Cot:Ultimo_'&Cot:ID,'',net:crc,,loc:extra)

where bCotizaciones is the browse name, Cot:Ulitmo is the name of the column field and Cot:Id the Id of the row record

The result is like:

<div id="div690197848_div" >

Then, I know the id to modify via javascript

-----------
Regards
Alberto